Yaron Koresh commited on
Commit
ede445b
·
verified ·
1 Parent(s): a30d9e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -725,7 +725,7 @@ def translate(txt,to_lang="en",from_lang=False):
725
  for index in range(math.ceil( len(words) / 512 )):
726
  chunk = " ".join(words[ index*512:(index+1)*512 ])
727
  inputs = tokenizer.encode(prefix+chunk, return_tensors="pt", max_length=float('inf'), truncation=False)
728
- gen = model.generate(chunk,input)
729
  toks = tokenizer.decode(gen[0], skip_special_tokens=True)
730
  ret = ret + ("" if ret == "" else " ") + toks
731
  log(f'RET translate with ret as {ret}')
 
725
  for index in range(math.ceil( len(words) / 512 )):
726
  chunk = " ".join(words[ index*512:(index+1)*512 ])
727
  inputs = tokenizer.encode(prefix+chunk, return_tensors="pt", max_length=float('inf'), truncation=False)
728
+ gen = model.generate(inputs)
729
  toks = tokenizer.decode(gen[0], skip_special_tokens=True)
730
  ret = ret + ("" if ret == "" else " ") + toks
731
  log(f'RET translate with ret as {ret}')