From cff63fb79b68e45a2e1b9110051a321b06962689 Mon Sep 17 00:00:00 2001 From: "xiangpeng.wxp" Date: Mon, 6 Feb 2023 05:26:55 +0000 Subject: [PATCH] [to #42322933] add en2ru and ru2en pipeline ut v4 Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/11549835 * add en2ru and ru2en pipeline ut v4 --- tests/pipelines/test_csanmt_translation.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/pipelines/test_csanmt_translation.py b/tests/pipelines/test_csanmt_translation.py index bd83d8fe..d989a6c4 100644 --- a/tests/pipelines/test_csanmt_translation.py +++ b/tests/pipelines/test_csanmt_translation.py @@ -56,6 +56,13 @@ class TranslationTest(unittest.TestCase, DemoCompatibilityCheck): pipeline_ins = pipeline(self.task, model=model_id) print(pipeline_ins(input=inputs)) + @unittest.skipUnless(test_level() >= 0, 'skip test in current test level') + def test_run_with_model_name_for_en2ru(self): + model_id = 'damo/nlp_csanmt_translation_en2ru_base' + inputs = 'When I was in my 20s, I saw my very first psychotherapy client.' + pipeline_ins = pipeline(self.task, model=model_id) + print(pipeline_ins(input=inputs)) + @unittest.skipUnless(test_level() >= 0, 'skip test in current test level') def test_run_with_model_name_for_fr2en(self): model_id = 'damo/nlp_csanmt_translation_fr2en' @@ -70,6 +77,13 @@ class TranslationTest(unittest.TestCase, DemoCompatibilityCheck): pipeline_ins = pipeline(self.task, model=model_id) print(pipeline_ins(input=inputs)) + @unittest.skipUnless(test_level() >= 0, 'skip test in current test level') + def test_run_with_model_name_for_ru2en(self): + model_id = 'damo/nlp_csanmt_translation_ru2en_base' + inputs = 'Это всего лишь пример.' + pipeline_ins = pipeline(self.task, model=model_id) + print(pipeline_ins(input=inputs)) + @unittest.skipUnless(test_level() >= 2, 'skip test in current test level') def test_run_with_default_model(self): inputs = '声明补充说,沃伦的同事都深感震惊,并且希望他能够投案自首。'