Yaron Koresh commited on
Commit
0e6de10
·
verified ·
1 Parent(s): f89f832

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -640,7 +640,7 @@ def translate(txt,to_lang="en",from_lang=False):
640
  if(from_lang == to_lang):
641
  log(f'RET translate with txt as {txt}')
642
  return txt
643
- inputs = tokenizer.encode(f"translate {from_lang} to {to_lang}: " + text, return_tensors="pt", max_length=float('inf'), truncation=False)
644
  chunks_length = math.ceil(get_tensor_length(inputs) / 512)
645
  ret = ""
646
  for index in range(chunks_length):
 
640
  if(from_lang == to_lang):
641
  log(f'RET translate with txt as {txt}')
642
  return txt
643
+ inputs = tokenizer.encode(f"translate {from_lang} to {to_lang}: " + txt, return_tensors="pt", max_length=float('inf'), truncation=False)
644
  chunks_length = math.ceil(get_tensor_length(inputs) / 512)
645
  ret = ""
646
  for index in range(chunks_length):