Update README.md
Browse files
README.md
CHANGED
@@ -45,7 +45,7 @@ text = "εγγΎγγ¦γγγγγγι‘γγγΎγγ"
|
|
45 |
def translate(text_src):
|
46 |
embeddings = src_tokenizer(text_src, return_attention_mask=False, return_token_type_ids=False, return_tensors='pt')
|
47 |
embeddings = {k: v for k, v in embeddings.items()}
|
48 |
-
output = model.generate(**embeddings)[0, 1:-1]
|
49 |
text_trg = trg_tokenizer.decode(output.cpu())
|
50 |
return text_trg
|
51 |
|
|
|
45 |
def translate(text_src):
|
46 |
embeddings = src_tokenizer(text_src, return_attention_mask=False, return_token_type_ids=False, return_tensors='pt')
|
47 |
embeddings = {k: v for k, v in embeddings.items()}
|
48 |
+
output = model.generate(**embeddings, max_length=500)[0, 1:-1]
|
49 |
text_trg = trg_tokenizer.decode(output.cpu())
|
50 |
return text_trg
|
51 |
|