Skip to content

Commit

Permalink
fix: incompatibility with newer transformers package (fixes thammegow…
Browse files Browse the repository at this point in the history
…da#20)

Signed-off-by: Stephen L. <LRQ3000@gmail.com>
  • Loading branch information
lrq3000 committed Nov 24, 2024
1 parent 1c0227e commit 541e5e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nllb_serve/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def translate():
inputs = {k:v.to(device) for k, v in inputs.items()}

translated_tokens = model.generate(
**inputs, forced_bos_token_id=tokenizer.lang_code_to_id[tgt_lang],
**inputs, forced_bos_token_id=tokenizer.convert_tokens_to_ids(tgt_lang),
max_length = max_length)
output = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
transformers>=4.21
transformers>=4.38
Flask==3.0.2
Werkzeug>=3.0.0
torch>=1.12
Expand Down

0 comments on commit 541e5e9

Please sign in to comment.