Update goai_helpers/goai_traduction.py
Browse files
goai_helpers/goai_traduction.py
CHANGED
@@ -22,7 +22,7 @@ def goai_traduction(text, src_lang, tgt_lang):
|
|
22 |
else:
|
23 |
model_id = "ArissBandoss/nllb-200-distilled-600M-finetuned-fr-to-mos-V4"
|
24 |
|
25 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id, token=auth_token)
|
26 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_id, token=auth_token).to(device)
|
27 |
|
28 |
# Ajout du code de langue source
|
|
|
22 |
else:
|
23 |
model_id = "ArissBandoss/nllb-200-distilled-600M-finetuned-fr-to-mos-V4"
|
24 |
|
25 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, token=auth_token, truncation=True, max_length=512)
|
26 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_id, token=auth_token).to(device)
|
27 |
|
28 |
# Ajout du code de langue source
|