Skip to content

Commit

Permalink
Potential fix for Windows errors
Browse files Browse the repository at this point in the history
  • Loading branch information
TaperChipmunk32 committed Oct 28, 2024
1 parent ac4fb63 commit 1e1a18f
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def test_train_non_empty_corpus() -> None:
)
trainer.train()
trainer.save()
trainer.close()

finetuned_engine = HuggingFaceNmtEngine(temp_dir, src_lang="es", tgt_lang="en", max_length=20)
finetuned_result = finetuned_engine.translate("una habitación individual por semana")
Expand Down Expand Up @@ -132,6 +133,7 @@ def test_update_tokenizer_missing_char() -> None:
)
trainer_nochar.train()
trainer_nochar.save()
trainer_nochar.close()

finetuned_engine_nochar = HuggingFaceNmtEngine(temp_dir, src_lang="en_XX", tgt_lang="es_XX", max_length=20)
finetuned_result_nochar = finetuned_engine_nochar._tokenizer.encode(
Expand All @@ -152,6 +154,7 @@ def test_update_tokenizer_missing_char() -> None:
)
trainer_char.train()
trainer_char.save()
trainer_char.close()

finetuned_engine_char = HuggingFaceNmtEngine(temp_dir, src_lang="en_XX", tgt_lang="es_XX", max_length=20)
finetuned_result_char = finetuned_engine_char._tokenizer.encode(
Expand Down Expand Up @@ -220,6 +223,7 @@ def test_update_tokenizer_missing_char_skip() -> None:
)
trainer_nochar.train()
trainer_nochar.save()
trainer_nochar.close()

finetuned_engine_nochar = HuggingFaceNmtEngine(temp_dir, src_lang="en", tgt_lang="es", max_length=20)
finetuned_result_nochar = finetuned_engine_nochar._tokenizer.encode(
Expand All @@ -239,6 +243,7 @@ def test_update_tokenizer_missing_char_skip() -> None:
)
trainer_char.train()
trainer_char.save()
trainer_char.close()

finetuned_engine_char = HuggingFaceNmtEngine(temp_dir, src_lang="en", tgt_lang="es", max_length=20)
finetuned_result_char = finetuned_engine_char._tokenizer.encode(
Expand Down Expand Up @@ -292,6 +297,7 @@ def test_update_tokenizer_missing_char_src() -> None:
)
trainer_nochar.train()
trainer_nochar.save()
trainer_nochar.close()

finetuned_engine_nochar = HuggingFaceNmtEngine(temp_dir, src_lang="en_XX", tgt_lang="es_XX", max_length=20)
finetuned_result_nochar = finetuned_engine_nochar._tokenizer.encode(
Expand All @@ -311,6 +317,7 @@ def test_update_tokenizer_missing_char_src() -> None:
)
trainer_char.train()
trainer_char.save()
trainer_char.close()

finetuned_engine_char = HuggingFaceNmtEngine(temp_dir, src_lang="en_XX", tgt_lang="es_XX", max_length=20)
finetuned_result_char = finetuned_engine_char._tokenizer.encode(
Expand Down Expand Up @@ -364,6 +371,7 @@ def test_update_tokenizer_missing_char_trg() -> None:
)
trainer_nochar.train()
trainer_nochar.save()
trainer_nochar.close()

finetuned_engine_nochar = HuggingFaceNmtEngine(temp_dir, src_lang="en_XX", tgt_lang="es_XX", max_length=20)
finetuned_result_nochar = finetuned_engine_nochar._tokenizer.encode(
Expand All @@ -383,6 +391,7 @@ def test_update_tokenizer_missing_char_trg() -> None:
)
trainer_char.train()
trainer_char.save()
trainer_char.close()

finetuned_engine_char = HuggingFaceNmtEngine(temp_dir, src_lang="en_XX", tgt_lang="es_XX", max_length=20)
finetuned_result_char = finetuned_engine_char._tokenizer.encode(
Expand Down Expand Up @@ -436,6 +445,7 @@ def test_update_tokenizer_no_missing_char() -> None:
)
trainer_nochar.train()
trainer_nochar.save()
trainer_nochar.close()

finetuned_engine_nochar = HuggingFaceNmtEngine(temp_dir, src_lang="en_XX", tgt_lang="es_XX", max_length=20)
finetuned_result_nochar = finetuned_engine_nochar._tokenizer.encode("una habitación individual por semana")
Expand All @@ -453,6 +463,7 @@ def test_update_tokenizer_no_missing_char() -> None:
)
trainer_char.train()
trainer_char.save()
trainer_char.close()

finetuned_engine_char = HuggingFaceNmtEngine(temp_dir, src_lang="en_XX", tgt_lang="es_XX", max_length=20)
finetuned_result_char = finetuned_engine_char._tokenizer.encode("una habitación individual por semana")
Expand Down

0 comments on commit 1e1a18f

Please sign in to comment.