From c99f3a9b8c0ede1578ebf0e32826a622f1c488ee Mon Sep 17 00:00:00 2001 From: ly119399 Date: Mon, 20 Jun 2022 16:03:50 +0800 Subject: [PATCH] dialog modeling ready --- modelscope/utils/constant.py | 2 +- tests/pipelines/nlp/test_dialog_modeling.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/modelscope/utils/constant.py b/modelscope/utils/constant.py index 7fbbb190..20ef117b 100644 --- a/modelscope/utils/constant.py +++ b/modelscope/utils/constant.py @@ -38,7 +38,7 @@ class Tasks(object): token_classification = 'token-classification' conversational = 'conversational' text_generation = 'text-generation' - dialog_modeling = 'dialog_modeling' + dialog_modeling = 'dialog-modeling' dialog_intent_prediction = 'dialog-intent-prediction' table_question_answering = 'table-question-answering' feature_extraction = 'feature-extraction' diff --git a/tests/pipelines/nlp/test_dialog_modeling.py b/tests/pipelines/nlp/test_dialog_modeling.py index 855bdff4..7d4da8fe 100644 --- a/tests/pipelines/nlp/test_dialog_modeling.py +++ b/tests/pipelines/nlp/test_dialog_modeling.py @@ -92,10 +92,9 @@ class DialogModelingTest(unittest.TestCase): } } - # @unittest.skip('test with snapshot_download') + @unittest.skip('test with snapshot_download') def test_run(self): - # cache_path = '/Users/yangliu/Space/maas_model/nlp_space_dialog-modeling' cache_path = snapshot_download(self.model_id) preprocessor = DialogModelingPreprocessor(model_dir=cache_path) @@ -124,12 +123,12 @@ class DialogModelingTest(unittest.TestCase): def test_run_with_model_from_modelhub(self): model = Model.from_pretrained(self.model_id) - preprocessor = DialogGenerationPreprocessor(model_dir=model.model_dir) + preprocessor = DialogModelingPreprocessor(model_dir=model.model_dir) pipelines = [ - DialogGenerationPipeline(model=model, preprocessor=preprocessor), + DialogModelingPipeline(model=model, preprocessor=preprocessor), pipeline( - task=Tasks.dialog_generation, + task=Tasks.dialog_modeling, model=model, preprocessor=preprocessor) ]