Spaces:
Running
on
Zero
Running
on
Zero
Update goai_helpers/goai_traduction.py
Browse files
goai_helpers/goai_traduction.py
CHANGED
@@ -24,6 +24,8 @@ def goai_traduction(text, src_lang, tgt_lang):
|
|
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 |
tgt_lang_id = tokenizer.convert_tokens_to_ids(tgt_lang)
|
29 |
|
|
|
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 |
+
print(model.lm_head.weight.shape) # doit être [vocab_size, hidden_size]
|
28 |
+
print(model.model.shared.weight.shape) # idem
|
29 |
|
30 |
tgt_lang_id = tokenizer.convert_tokens_to_ids(tgt_lang)
|
31 |
|