You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_translation_trainer.py 808 B

123456789101112131415161718192021222324
  1. # Copyright (c) Alibaba, Inc. and its affiliates.
  2. import unittest
  3. from modelscope.trainers.nlp import CsanmtTranslationTrainer
  4. from modelscope.utils.test_utils import test_level
  5. class TranslationTest(unittest.TestCase):
  6. @unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
  7. def test_run_with_model_name_for_en2zh(self):
  8. model_id = 'damo/nlp_csanmt_translation_en2zh'
  9. trainer = CsanmtTranslationTrainer(model=model_id)
  10. trainer.train()
  11. @unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
  12. def test_run_with_model_name_for_en2fr(self):
  13. model_id = 'damo/nlp_csanmt_translation_en2fr'
  14. trainer = CsanmtTranslationTrainer(model=model_id)
  15. trainer.train()
  16. if __name__ == '__main__':
  17. unittest.main()