[to #43259593] task_oriented_conversation model hub use master branch

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9652513
This commit is contained in:
ly119399
2022-08-05 14:01:01 +08:00
committed by yingda.chen
parent 79d602a1da
commit 4af5ae52ce

View File

@@ -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)