sappho192 commited on
Commit
80ee466
β€’
1 Parent(s): a959882

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +1 -1
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