From 4af5ae52cec47ca549e9ca6b07776caa3b7f6214 Mon Sep 17 00:00:00 2001 From: ly119399 Date: Fri, 5 Aug 2022 14:01:01 +0800 Subject: [PATCH] [to #43259593] task_oriented_conversation model hub use master branch Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9652513 --- .../test_task_oriented_conversation.py | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/tests/pipelines/test_task_oriented_conversation.py b/tests/pipelines/test_task_oriented_conversation.py index ab24df88..a2232180 100644 --- a/tests/pipelines/test_task_oriented_conversation.py +++ b/tests/pipelines/test_task_oriented_conversation.py @@ -108,8 +108,7 @@ class TaskOrientedConversationTest(unittest.TestCase): @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') def test_run_by_direct_model_download(self): - cache_path = snapshot_download( - self.model_id, revision='task_oriented_conversation') + cache_path = snapshot_download(self.model_id) preprocessor = DialogModelingPreprocessor(model_dir=cache_path) model = SpaceForDialogModeling( @@ -128,8 +127,7 @@ class TaskOrientedConversationTest(unittest.TestCase): @unittest.skipUnless(test_level() >= 0, 'skip test in current test level') def test_run_with_model_from_modelhub(self): - model = Model.from_pretrained( - self.model_id, revision='task_oriented_conversation') + model = Model.from_pretrained(self.model_id) preprocessor = DialogModelingPreprocessor(model_dir=model.model_dir) pipelines = [ @@ -147,25 +145,17 @@ class TaskOrientedConversationTest(unittest.TestCase): def test_run_with_model_name(self): pipelines = [ pipeline( - task=Tasks.task_oriented_conversation, - model=self.model_id, - model_revision='task_oriented_conversation'), + task=Tasks.task_oriented_conversation, model=self.model_id), pipeline( - task=Tasks.task_oriented_conversation, - model=self.model_id, - model_revision='task_oriented_conversation') + task=Tasks.task_oriented_conversation, model=self.model_id) ] self.generate_and_print_dialog_response(pipelines) @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') def test_run_with_default_model(self): pipelines = [ - pipeline( - task=Tasks.task_oriented_conversation, - model_revision='task_oriented_conversation'), - pipeline( - task=Tasks.task_oriented_conversation, - model_revision='task_oriented_conversation') + pipeline(task=Tasks.task_oriented_conversation), + pipeline(task=Tasks.task_oriented_conversation) ] self.generate_and_print_dialog_response(pipelines)