Skip to content

Commit

Permalink
fix src_vocab path in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
francoishernandez committed Jul 1, 2024
1 parent 6e6d8f7 commit 9b54bb9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion eole/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
data={
"dummy": Dataset(path_src="eole/tests/data/src-train.txt")
}, # actual file path (tested in validate)
src_vocab="dummy",
src_vocab="eole/tests/data/vocab-train.src",
share_vocab=True,
model=CustomModelConfig(),
) # now required by validation
Expand Down
19 changes: 11 additions & 8 deletions eole/tests/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_vocab_required_transform(self):
data={
"dummy": Dataset(path_src="eole/tests/data/src-train.txt")
}, # actual file path (tested in validate)
src_vocab="dummy",
src_vocab="eole/tests/data/vocab-train.src",
share_vocab=True,
seed=-1,
transforms_configs={"switchout": {"switchout_temperature": 1.0}},
Expand Down Expand Up @@ -70,7 +70,10 @@ def test_transform_specials(self):
)
# opt = Namespace(data=corpora)
opt = TrainConfig(
data=corpora, src_vocab="dummy", share_vocab=True, model=CustomModelConfig()
data=corpora,
src_vocab="eole/tests/data/vocab-train.src",
share_vocab=True,
model=CustomModelConfig(),
)
specials = get_specials(opt, transforms_cls)
specials_expected = {"src": ["⦅_pf_src⦆"], "tgt": ["⦅_pf_tgt⦆"]}
Expand All @@ -94,7 +97,7 @@ def test_transform_pipe(self):
opt = TrainConfig(
data=corpora,
seed=-1,
src_vocab="dummy",
src_vocab="eole/tests/data/vocab-train.src",
share_vocab=True,
model=CustomModelConfig(),
)
Expand All @@ -107,7 +110,7 @@ def test_transform_pipe(self):
data={
"dummy": Dataset(path_src="eole/tests/data/src-train.txt")
}, # actual file path (tested in validate)
src_vocab="dummy",
src_vocab="eole/tests/data/vocab-train.src",
share_vocab=True,
transforms_configs={
"filtertoolong": {"src_seq_length": 4, "tgt_seq_length": 4}
Expand Down Expand Up @@ -151,7 +154,7 @@ def test_prefix(self):
opt = TrainConfig(
data=corpora,
seed=-1,
src_vocab="dummy",
src_vocab="eole/tests/data/vocab-train.src",
share_vocab=True,
model=CustomModelConfig(),
)
Expand Down Expand Up @@ -511,7 +514,7 @@ def test_tokendrop(self):
data={
"dummy": Dataset(path_src="eole/tests/data/src-train.txt")
}, # actual file path (tested in validate)
src_vocab="dummy",
src_vocab="eole/tests/data/vocab-train.src",
share_vocab=True,
seed=3434,
transforms_configs={"tokendrop": {"tokendrop_temperature": 0.1}},
Expand All @@ -537,7 +540,7 @@ def test_tokenmask(self):
data={
"dummy": Dataset(path_src="eole/tests/data/src-train.txt")
}, # actual file path (tested in validate)
src_vocab="dummy",
src_vocab="eole/tests/data/vocab-train.src",
share_vocab=True,
seed=3434,
transforms_configs={"tokenmask": {"tokenmask_temperature": 0.1}},
Expand All @@ -563,7 +566,7 @@ def test_switchout(self):
data={
"dummy": Dataset(path_src="eole/tests/data/src-train.txt")
}, # actual file path (tested in validate)
src_vocab="dummy",
src_vocab="eole/tests/data/vocab-train.src",
share_vocab=True,
seed=3434,
transforms_configs={"switchout": {"switchout_temperature": 0.1}},
Expand Down

0 comments on commit 9b54bb9

Please sign in to comment.