mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-24 03:59:23 +01:00
fix
This commit is contained in:
@@ -15,6 +15,7 @@ class Models(object):
|
||||
bert = 'bert'
|
||||
palm = 'palm-v2'
|
||||
structbert = 'structbert'
|
||||
veco = 'veco'
|
||||
|
||||
# audio models
|
||||
sambert_hifi_16k = 'sambert-hifi-16k'
|
||||
|
||||
@@ -2,7 +2,8 @@ from typing import Any, Dict, Optional, Union
|
||||
|
||||
import numpy as np
|
||||
|
||||
from ...utils.constant import Tasks
|
||||
from modelscope.metainfo import Models
|
||||
from modelscope.utils.constant import Tasks
|
||||
from ..base import Model, Tensor
|
||||
from ..builder import MODELS
|
||||
|
||||
@@ -36,14 +37,14 @@ class AliceMindBaseForMaskedLM(Model):
|
||||
return {'logits': rst['logits'], 'input_ids': inputs['input_ids']}
|
||||
|
||||
|
||||
@MODELS.register_module(Tasks.fill_mask, module_name=r'sbert')
|
||||
@MODELS.register_module(Tasks.fill_mask, module_name=Models.structbert)
|
||||
class StructBertForMaskedLM(AliceMindBaseForMaskedLM):
|
||||
# The StructBert for MaskedLM uses the same underlying model structure
|
||||
# as the base model class.
|
||||
pass
|
||||
|
||||
|
||||
@MODELS.register_module(Tasks.fill_mask, module_name=r'veco')
|
||||
@MODELS.register_module(Tasks.fill_mask, module_name=Models.veco)
|
||||
class VecoForMaskedLM(AliceMindBaseForMaskedLM):
|
||||
# The Veco for MaskedLM uses the same underlying model structure
|
||||
# as the base model class.
|
||||
|
||||
@@ -10,7 +10,6 @@ from modelscope.models.nlp import StructBertForMaskedLM, VecoForMaskedLM
|
||||
from modelscope.pipelines import FillMaskPipeline, pipeline
|
||||
from modelscope.preprocessors import FillMaskPreprocessor
|
||||
from modelscope.utils.constant import Tasks
|
||||
from modelscope.utils.hub import get_model_cache_dir
|
||||
from modelscope.utils.test_utils import test_level
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user