Yaron Koresh commited on
Commit
9225203
·
verified ·
1 Parent(s): 5bb2be7

Update app.py

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