fix: pipeline module_name from model_type to 'fill_mask' & fix merge bug

This commit is contained in:
suluyan
2022-06-22 16:53:12 +08:00
parent e50e0e0fd1
commit e43e5930f4
3 changed files with 3 additions and 4 deletions

View File

@@ -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')
}

View File

@@ -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,

View File

@@ -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()}