Set max_length=500
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ model = transformers.EncoderDecoderModel.from_pretrained("sappho192/ffxiv-ja-ko-
|
|
11 |
def translate(text_src):
|
12 |
embeddings = src_tokenizer(text_src, return_attention_mask=False, return_token_type_ids=False, return_tensors='pt')
|
13 |
embeddings = {k: v for k, v in embeddings.items()}
|
14 |
-
output = model.generate(**embeddings)[0, 1:-1]
|
15 |
text_trg = trg_tokenizer.decode(output.cpu())
|
16 |
return text_trg
|
17 |
|
|
|
11 |
def translate(text_src):
|
12 |
embeddings = src_tokenizer(text_src, return_attention_mask=False, return_token_type_ids=False, return_tensors='pt')
|
13 |
embeddings = {k: v for k, v in embeddings.items()}
|
14 |
+
output = model.generate(**embeddings, max_length=500)[0, 1:-1]
|
15 |
text_trg = trg_tokenizer.decode(output.cpu())
|
16 |
return text_trg
|
17 |
|