[swingdeploy]sentence_embedding

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/14395686
* swingdeploy_sentence_embedding
This commit is contained in:
suluyan.sly
2023-10-23 16:44:43 +08:00
committed by wenmeng.zwm
parent fb7328f4ec
commit 77aa33ad5d
2 changed files with 14 additions and 0 deletions

View File

@@ -121,6 +121,7 @@ def pipeline(task: str = None,
ignore_file_pattern=ignore_file_pattern)
if pipeline_name is None and kwargs.get('llm_first'):
pipeline_name = llm_first_checker(model, model_revision)
kwargs.pop('llm_first')
pipeline_props = {'type': pipeline_name}
if pipeline_name is None:
# get default pipeline for this task

View File

@@ -145,6 +145,19 @@
"image":"http://modelscope.oss-cn-beijing.aliyuncs.com/demo/images/image_salient_detection.jpg"
}
},
"sentence-embedding":{
"input": {
"source_sentence":[
"吃完海鲜可以喝牛奶吗?"
],
"sentences_to_compare":[
"不可以,早晨喝牛奶不科学",
"吃了海鲜后是不能再喝牛奶的因为牛奶中含得有维生素C如果海鲜喝牛奶一起服用会对人体造成一定的伤害",
"吃海鲜是不能同时喝牛奶吃水果这个至少间隔6小时以上才可以。",
"吃海鲜是不可以吃柠檬的因为其中的维生素C会和海鲜中的矿物质形成砷"
]
}
},
"shop-segmentation":{
"input":{
"image":"http://modelscope.oss-cn-beijing.aliyuncs.com/demo/images/shop_segmentation.jpg"