mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-24 03:59:23 +01:00
add space to metainfo
This commit is contained in:
@@ -16,6 +16,7 @@ class Models(object):
|
||||
palm = 'palm-v2'
|
||||
structbert = 'structbert'
|
||||
veco = 'veco'
|
||||
space = 'space'
|
||||
|
||||
# audio models
|
||||
sambert_hifi_16k = 'sambert-hifi-16k'
|
||||
@@ -98,6 +99,8 @@ class Preprocessors(object):
|
||||
token_cls_tokenizer = 'token-cls-tokenizer'
|
||||
nli_tokenizer = 'nli-tokenizer'
|
||||
sen_cls_tokenizer = 'sen-cls-tokenizer'
|
||||
dialog_intent_preprocessor = 'dialog-intent-preprocessor'
|
||||
dialog_modeling_preprocessor = 'dialog-modeling-preprocessor'
|
||||
|
||||
# audio preprocessor
|
||||
linear_aec_fbank = 'linear-aec-fbank'
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
from typing import Any, Dict
|
||||
|
||||
from ....metainfo import Models
|
||||
from ....preprocessors.space.fields.intent_field import IntentBPETextField
|
||||
from ....trainers.nlp.space.trainer.intent_trainer import IntentTrainer
|
||||
from ....utils.config import Config
|
||||
@@ -13,7 +14,8 @@ from .model.model_base import SpaceModelBase
|
||||
__all__ = ['SpaceForDialogIntentModel']
|
||||
|
||||
|
||||
@MODELS.register_module(Tasks.dialog_intent_prediction, module_name=r'space')
|
||||
@MODELS.register_module(
|
||||
Tasks.dialog_intent_prediction, module_name=Models.space)
|
||||
class SpaceForDialogIntentModel(Model):
|
||||
|
||||
def __init__(self, model_dir: str, *args, **kwargs):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from ....metainfo import Models
|
||||
from ....preprocessors.space.fields.gen_field import MultiWOZBPETextField
|
||||
from ....trainers.nlp.space.trainer.gen_trainer import MultiWOZTrainer
|
||||
from ....utils.config import Config
|
||||
@@ -13,7 +14,7 @@ from .model.model_base import SpaceModelBase
|
||||
__all__ = ['SpaceForDialogModelingModel']
|
||||
|
||||
|
||||
@MODELS.register_module(Tasks.dialog_modeling, module_name=r'space')
|
||||
@MODELS.register_module(Tasks.dialog_modeling, module_name=Models.space)
|
||||
class SpaceForDialogModelingModel(Model):
|
||||
|
||||
def __init__(self, model_dir: str, *args, **kwargs):
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import os
|
||||
from typing import Any, Dict
|
||||
|
||||
from ...metainfo import Preprocessors
|
||||
from ...utils.config import Config
|
||||
from ...utils.constant import Fields, ModelFile
|
||||
from ...utils.type_assert import type_assert
|
||||
@@ -13,7 +14,8 @@ from .fields.intent_field import IntentBPETextField
|
||||
__all__ = ['DialogIntentPredictionPreprocessor']
|
||||
|
||||
|
||||
@PREPROCESSORS.register_module(Fields.nlp, module_name=r'space-intent')
|
||||
@PREPROCESSORS.register_module(
|
||||
Fields.nlp, module_name=Preprocessors.dialog_intent_preprocessor)
|
||||
class DialogIntentPredictionPreprocessor(Preprocessor):
|
||||
|
||||
def __init__(self, model_dir: str, *args, **kwargs):
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import os
|
||||
from typing import Any, Dict
|
||||
|
||||
from ...metainfo import Preprocessors
|
||||
from ...utils.config import Config
|
||||
from ...utils.constant import Fields, ModelFile
|
||||
from ...utils.type_assert import type_assert
|
||||
@@ -13,7 +14,8 @@ from .fields.gen_field import MultiWOZBPETextField
|
||||
__all__ = ['DialogModelingPreprocessor']
|
||||
|
||||
|
||||
@PREPROCESSORS.register_module(Fields.nlp, module_name=r'space-modeling')
|
||||
@PREPROCESSORS.register_module(
|
||||
Fields.nlp, module_name=Preprocessors.dialog_modeling_preprocessor)
|
||||
class DialogModelingPreprocessor(Preprocessor):
|
||||
|
||||
def __init__(self, model_dir: str, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user