Spaces:
Running
on
Zero
Running
on
Zero
Update goai_helpers/goai_traduction.py
Browse files
goai_helpers/goai_traduction.py
CHANGED
@@ -39,9 +39,13 @@ def goai_traduction(text, src_lang, tgt_lang):
|
|
39 |
|
40 |
# Bloquer complètement le token EOS jusqu'à un certain point
|
41 |
outputs = model.generate(
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
45 |
)
|
46 |
|
47 |
# Décodage
|
|
|
39 |
|
40 |
# Bloquer complètement le token EOS jusqu'à un certain point
|
41 |
outputs = model.generate(
|
42 |
+
**inputs,
|
43 |
+
forced_bos_token_id=tgt_lang_id,
|
44 |
+
max_new_tokens=1024,
|
45 |
+
early_stopping=False,
|
46 |
+
num_beams=5,
|
47 |
+
no_repeat_ngram_size=0,
|
48 |
+
length_penalty=1.0
|
49 |
)
|
50 |
|
51 |
# Décodage
|