Skip to content

Commit

Permalink
Move test config to contrib
Browse files Browse the repository at this point in the history
  • Loading branch information
eu9ene committed Feb 8, 2024
1 parent 9ec77d3 commit a8e78f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 4 additions & 5 deletions tests/test_config.yml → contrib/test_full_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ end:
modifiers:
- UpperCase: 0.05
- TitleCase: 0.05
- Tags: 0.08
custom_detok_src: null
custom_detok_trg: zh
template: "__source__ {src} __target__ {trg} __done__"
- Prefix: 0.05
min_words: 2
max_words: 5
Expand All @@ -55,7 +51,10 @@ modifiers:
random_space: 0.1 # Adds a random space in the string.
repeated_char: 0.1 # Repeats a random word character.
unichar: 0.1 # Replaces a random consecutive repeated letter with a single letter.

- Tags: 0.08
custom_detok_src: null
custom_detok_trg: zh
template: "__source__ {src} __target__ {trg} __done__"

seed: 1111
trainer: /usr/bin/cat
6 changes: 5 additions & 1 deletion tests/test_trainer_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ def test_marian_log_args(self):
self.assertEqual({**vars(parsed), **expected}, vars(parsed))

def test_config_loader(self):
config_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'test_config.yml')
config_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
os.pardir,
'contrib',
'test_full_config.yml')
with open(config_path, 'r', encoding='utf-8') as fh:
config = yaml.safe_load(fh)

Expand Down

0 comments on commit a8e78f4

Please sign in to comment.