Update goai_helpers/goai_traduction.py
Browse files
goai_helpers/goai_traduction.py
CHANGED
@@ -38,12 +38,17 @@ def goai_traduction(text, src_lang, tgt_lang):
|
|
38 |
# Génération avec paramètres améliorés
|
39 |
outputs = model.generate(
|
40 |
**inputs,
|
41 |
-
forced_bos_token_id=tgt_lang_id,
|
42 |
-
|
43 |
-
min_length=10,
|
44 |
length_penalty=1.0,
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
)
|
48 |
|
49 |
print("Token IDs:", outputs)
|
|
|
38 |
# Génération avec paramètres améliorés
|
39 |
outputs = model.generate(
|
40 |
**inputs,
|
41 |
+
forced_bos_token_id=tgt_lang_id,
|
42 |
+
max_length=512,
|
|
|
43 |
length_penalty=1.0,
|
44 |
+
num_beams=4,
|
45 |
+
do_sample=True,
|
46 |
+
temperature=1.0,
|
47 |
+
top_k=50,
|
48 |
+
top_p=0.95,
|
49 |
+
repetition_penalty=1.2,
|
50 |
+
no_repeat_ngram_size=3,
|
51 |
+
eos_token_id=None
|
52 |
)
|
53 |
|
54 |
print("Token IDs:", outputs)
|