mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-24 12:09:22 +01:00
* add en-zh en-es es-en base translation models
* add en-zh en-es es-en base translation models
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/10895782
* 新增英中/英西/西英-base机器翻译模型
* 新增英中/英西/西英-base机器翻译模型
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
# Copyright (c) Alibaba, Inc. and its affiliates.
|
|
import unittest
|
|
|
|
from modelscope.trainers.nlp import CsanmtTranslationTrainer
|
|
from modelscope.utils.test_utils import test_level
|
|
|
|
|
|
class TranslationTest(unittest.TestCase):
|
|
|
|
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
|
|
def test_run_with_model_name_for_en2zh(self):
|
|
model_id = 'damo/nlp_csanmt_translation_en2zh'
|
|
trainer = CsanmtTranslationTrainer(model=model_id)
|
|
trainer.train()
|
|
|
|
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
|
|
def test_run_with_model_name_for_en2fr(self):
|
|
model_id = 'damo/nlp_csanmt_translation_en2fr'
|
|
trainer = CsanmtTranslationTrainer(model=model_id)
|
|
trainer.train()
|
|
|
|
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
|
|
def test_run_with_model_name_for_en2es(self):
|
|
model_id = 'damo/nlp_csanmt_translation_en2es'
|
|
trainer = CsanmtTranslationTrainer(model=model_id)
|
|
trainer.train()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|