Skip to content

Commit

Permalink
Revert "fixes and checks for build errors"
Browse files Browse the repository at this point in the history
This reverts commit 5d89837.
  • Loading branch information
johnml1135 committed Dec 13, 2023
1 parent 5d89837 commit 5203d87
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"eng_Latn",
"--clearml",
"--build-options",
"{\"huggingface\": {\"max_steps\": 10}}"
"{\"max_steps\": 10}"
]
},
{
Expand All @@ -41,4 +41,4 @@
"justMyCode": false
}
]
}
}
4 changes: 2 additions & 2 deletions machine/jobs/huggingface/hugging_face_nmt_model_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ def __init__(self, config: Any, shared_file_service: SharedFileService) -> None:
args = config.huggingface.train_params.to_dict()
args["output_dir"] = str(self._model_dir)
args["overwrite_output_dir"] = True
if "max_steps" in self._config.huggingface:
if "max_steps" in self._config:
if self._config.max_steps > 50000:
raise ValueError("max_steps must be less than or equal to 50000")
args["max_steps"] = self._config.huggingface.max_steps
args["max_steps"] = self._config.max_steps
parser = HfArgumentParser(cast(Any, Seq2SeqTrainingArguments))
self._training_args = cast(Seq2SeqTrainingArguments, parser.parse_dict(args)[0])
if (
Expand Down
2 changes: 1 addition & 1 deletion machine/jobs/nmt_engine_build_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def run(
writer = stack.enter_context(self._shared_file_service.open_target_pretranslation_writer())
current_inference_step = 0
phase_progress(ProgressStatus.from_step(current_inference_step, inference_step_count))
batch_size = self._config.huggingface.batch_size
batch_size = self._config["batch_size"]
for pi_batch in batch(src_pretranslations, batch_size):
if check_canceled is not None:
check_canceled()
Expand Down
6 changes: 3 additions & 3 deletions machine/jobs/settings.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
default:
model_type: huggingface
max_steps: 20000
data_dir: ~/machine
batch_size: 1024
huggingface:
max_steps: 20000
batch_size: 1024
parent_model_name: facebook/nllb-200-distilled-1.3B
train_params:
do_train: true
Expand Down Expand Up @@ -31,8 +31,8 @@ development:
generate_params:
num_beams: 1
staging:
max_steps: 10
huggingface:
max_steps: 10
parent_model_name: facebook/nllb-200-distilled-600M
generate_params:
num_beams: 1

0 comments on commit 5203d87

Please sign in to comment.