Download pool/shard009/Python/0080333_running.py from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard009/Python/0080333_running.py
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard009/Python/0080333_running.py
-
curl -L -o 0080333_running.py https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard009/Python/0080333_running.py
1.03 kB
| import os | |
| import time | |
| from testcases import ModernMTTestCase, TEST_RESOURCES | |
| TRAIN_FOLDER = os.path.join(TEST_RESOURCES, 'training', 'data') | |
| class HealthCheckTest(ModernMTTestCase): | |
| mmt_engine_archive = os.path.join(TEST_RESOURCES, 'stub_en_it_engine.tar.gz') | |
| def test_health_check(self): | |
| self.mmt.api.health_check() | |
| result = self.mmt.api.translate('en', 'it', 'hello world') | |
| self.assertIn('translation', result) | |
| self.assertGreater(len(result['translation']), 0) | |
| self.mmt.api.health_check() | |
| time.sleep(6) | |
| self.mmt.api.health_check() | |
| class TrainingTest(ModernMTTestCase): | |
| def test_train_example(self): | |
| self.mmt.create() | |
| self.mmt.start() | |
| self.mmt.api.health_check() | |
| result = self.mmt.api.translate('en', 'it', 'hello world') | |
| self.assertIn('translation', result) | |
| self.assertGreater(len(result['translation']), 0) | |
| self.mmt.api.health_check() | |
| time.sleep(6) | |
| self.mmt.api.health_check() | |