From 6355327a2cd75c92ea63d05f27fd7d5bae57c090 Mon Sep 17 00:00:00 2001 From: TaperChipmunk32 Date: Mon, 28 Oct 2024 10:12:33 -0500 Subject: [PATCH] Revert "Potential fix for Windows errors" This reverts commit 1e1a18f53e8bf3f88ed6cec46f14bdc047751f79. --- .../test_hugging_face_nmt_model_trainer.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tests/translation/huggingface/test_hugging_face_nmt_model_trainer.py b/tests/translation/huggingface/test_hugging_face_nmt_model_trainer.py index f197c5e..586a6f3 100644 --- a/tests/translation/huggingface/test_hugging_face_nmt_model_trainer.py +++ b/tests/translation/huggingface/test_hugging_face_nmt_model_trainer.py @@ -82,7 +82,6 @@ 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") @@ -133,7 +132,6 @@ 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( @@ -154,7 +152,6 @@ 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( @@ -223,7 +220,6 @@ 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( @@ -243,7 +239,6 @@ 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( @@ -297,7 +292,6 @@ 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( @@ -317,7 +311,6 @@ 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( @@ -371,7 +364,6 @@ 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( @@ -391,7 +383,6 @@ 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( @@ -445,7 +436,6 @@ 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") @@ -463,7 +453,6 @@ 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")