Browse Source

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

master
suluyan 3 years ago
parent
commit
e43e5930f4
3 changed files with 3 additions and 4 deletions
  1. +1
    -1
      modelscope/pipelines/builder.py
  2. +1
    -2
      modelscope/pipelines/nlp/fill_mask_pipeline.py
  3. +1
    -1
      modelscope/preprocessors/nlp.py

+ 1
- 1
modelscope/pipelines/builder.py 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')
}




+ 1
- 2
modelscope/pipelines/nlp/fill_mask_pipeline.py 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,


+ 1
- 1
modelscope/preprocessors/nlp.py 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()}




Loading…
Cancel
Save