Update goai_helpers/goai_traduction.py
Browse files
goai_helpers/goai_traduction.py
CHANGED
@@ -25,6 +25,9 @@ def goai_traduction(text, src_lang, tgt_lang):
|
|
25 |
tokenizer = AutoTokenizer.from_pretrained(model_id, token=auth_token)
|
26 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_id, token=auth_token).to(device)
|
27 |
|
|
|
|
|
|
|
28 |
print(tokenizer.model_max_length)
|
29 |
print(model.model.encoder.embed_positions.weights.shape)
|
30 |
# Configuration du tokenizer
|
|
|
25 |
tokenizer = AutoTokenizer.from_pretrained(model_id, token=auth_token)
|
26 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_id, token=auth_token).to(device)
|
27 |
|
28 |
+
print(f"Texte brut ({len(text)} caractères / {len(text.split())} mots):")
|
29 |
+
print(text)
|
30 |
+
|
31 |
print(tokenizer.model_max_length)
|
32 |
print(model.model.encoder.embed_positions.weights.shape)
|
33 |
# Configuration du tokenizer
|