Skip to content

Commit 97d244d

Browse files
authored
Merge pull request #22 from wasertech/copilot/fix-21
Fix max_length argument type to prevent TypeError in translation pipeline
2 parents c2f9703 + 57bc1ba commit 97d244d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

translator/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def parse_arguments():
4949
argument_parse.add_argument('--po', action='store_true', help="Translate PO (Portable Object) files instead of text files.")
5050
argument_parse.add_argument('--force', action='store_true', help="Force translation ignoring cache (text files) or translate all entries including translated ones (PO files).")
5151
argument_parse.add_argument('-S', '--save', type=str, help="Path to text file to save translations.")
52-
argument_parse.add_argument('-l', '--max_length', default=max_translation_lenght, help="Max length of output.")
52+
argument_parse.add_argument('-l', '--max_length', default=max_translation_lenght, type=int, help="Max length of output.")
5353
argument_parse.add_argument('-m', '--model_id', default=default_translator_model, help="HuggingFace model ID to use.")
5454
argument_parse.add_argument('-p', '--pipeline', default=default_translator_pipeline, help="Pipeline task to use.")
5555
argument_parse.add_argument('-b', '--batch_size', default=128, type=int, help="Number of sentences to batch for translation.")

0 commit comments

Comments
 (0)