mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-24 03:59:23 +01:00
fix: pipeline module_name from model_type to 'fill_mask' & fix merge bug
This commit is contained in:
@@ -37,7 +37,7 @@ DEFAULT_MODEL_FOR_PIPELINE = {
|
||||
'damo/cv_unet_person-image-cartoon_compound-models'),
|
||||
Tasks.ocr_detection: (Pipelines.ocr_detection,
|
||||
'damo/cv_resnet18_ocr-detection-line-level_damo'),
|
||||
Tasks.fill_mask: ('veco', 'damo/nlp_veco_fill-mask_large')
|
||||
Tasks.fill_mask: (Pipelines.fill_mask, 'damo/nlp_veco_fill-mask_large')
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,8 +11,7 @@ from ..builder import PIPELINES
|
||||
__all__ = ['FillMaskPipeline']
|
||||
|
||||
|
||||
@PIPELINES.register_module(Tasks.fill_mask, module_name=r'sbert')
|
||||
@PIPELINES.register_module(Tasks.fill_mask, module_name=r'veco')
|
||||
@PIPELINES.register_module(Tasks.fill_mask, module_name=r'fill_mask')
|
||||
class FillMaskPipeline(Pipeline):
|
||||
|
||||
def __init__(self,
|
||||
|
||||
@@ -178,7 +178,7 @@ class TextGenerationPreprocessor(Preprocessor):
|
||||
|
||||
rst['input_ids'].append(feature['input_ids'])
|
||||
rst['attention_mask'].append(feature['attention_mask'])
|
||||
rst['token_type_ids'].append(feature['token_type_ids'])
|
||||
|
||||
return {k: torch.tensor(v) for k, v in rst.items()}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user