diff --git a/modelscope/pipelines/__init__.py b/modelscope/pipelines/__init__.py index b0bd7489..74f5507f 100644 --- a/modelscope/pipelines/__init__.py +++ b/modelscope/pipelines/__init__.py @@ -1,6 +1,7 @@ -# from .audio import LinearAECPipeline -# from .audio.ans_pipeline import ANSPipeline +from .audio import LinearAECPipeline +from .audio.ans_pipeline import ANSPipeline from .base import Pipeline from .builder import pipeline +from .cv import * # noqa F403 from .multi_modal import * # noqa F403 from .nlp import * # noqa F403 diff --git a/modelscope/pipelines/nlp/dialog_intent_prediction_pipeline.py b/modelscope/pipelines/nlp/dialog_intent_prediction_pipeline.py index 4b2e29dd..4323dec6 100644 --- a/modelscope/pipelines/nlp/dialog_intent_prediction_pipeline.py +++ b/modelscope/pipelines/nlp/dialog_intent_prediction_pipeline.py @@ -44,7 +44,7 @@ class DialogIntentPredictionPipeline(Pipeline): pos = np.where(pred == np.max(pred)) result = { - 'pred': pred, + 'prediction': pred, 'label_pos': pos[0], 'label': self.categories[pos[0][0]] } diff --git a/modelscope/pipelines/nlp/dialog_modeling_pipeline.py b/modelscope/pipelines/nlp/dialog_modeling_pipeline.py index 76b00511..0261b2e4 100644 --- a/modelscope/pipelines/nlp/dialog_modeling_pipeline.py +++ b/modelscope/pipelines/nlp/dialog_modeling_pipeline.py @@ -43,6 +43,6 @@ class DialogModelingPipeline(Pipeline): assert len(sys_rsp) > 2 sys_rsp = sys_rsp[1:len(sys_rsp) - 1] - inputs['sys'] = sys_rsp + inputs['response'] = sys_rsp return inputs diff --git a/modelscope/pipelines/outputs.py b/modelscope/pipelines/outputs.py index f7592410..5af43ab7 100644 --- a/modelscope/pipelines/outputs.py +++ b/modelscope/pipelines/outputs.py @@ -178,10 +178,10 @@ TASK_OUTPUTS = { # 4.31488479e-05, 4.94503947e-05, 4.30105974e-05, 1.00963116e-04, # 2.82062047e-05, 1.15582036e-04, 4.48261271e-05, 3.99339879e-05, # 7.27692823e-05], dtype=float32), 'label_pos': array([11]), 'label': 'lost_or_stolen_card'} - Tasks.dialog_intent_prediction: ['pred', 'label_pos', 'label'], + Tasks.dialog_intent_prediction: ['prediction', 'label_pos', 'label'], # sys : ['you', 'are', 'welcome', '.', 'have', 'a', 'great', 'day', '!'] - Tasks.dialog_modeling: ['sys'], + Tasks.dialog_modeling: ['response'], # ============ audio tasks =================== diff --git a/tests/pipelines/test_dialog_modeling.py b/tests/pipelines/test_dialog_modeling.py index cd17502e..7279bbff 100644 --- a/tests/pipelines/test_dialog_modeling.py +++ b/tests/pipelines/test_dialog_modeling.py @@ -116,7 +116,7 @@ class DialogModelingTest(unittest.TestCase): 'user_input': user, 'history': result }) - print('sys : {}'.format(result['sys'])) + print('response : {}'.format(result['response'])) @unittest.skipUnless(test_level() >= 0, 'skip test in current test level') def test_run_with_model_from_modelhub(self): @@ -140,7 +140,7 @@ class DialogModelingTest(unittest.TestCase): 'user_input': user, 'history': result }) - print('sys : {}'.format(result['sys'])) + print('response : {}'.format(result['response'])) if __name__ == '__main__':