Yaron Koresh commited on
Commit
20f447c
·
verified ·
1 Parent(s): 8766245

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -646,7 +646,7 @@ def translate(txt,to_lang="en",from_lang=False):
646
  for index in range(chunks_length):
647
  ret = ret + ("" if ret == "" else " ") + tokenizer.decode(
648
  model.generate(
649
- inputs[0][ index*512:index*512+512 ]
650
  )[0]
651
  )
652
  log(f'RET translate with ret as {ret}')
 
646
  for index in range(chunks_length):
647
  ret = ret + ("" if ret == "" else " ") + tokenizer.decode(
648
  model.generate(
649
+ torch.tensor(list(inputs[0][ index*512:index*512+512 ]))
650
  )[0]
651
  )
652
  log(f'RET translate with ret as {ret}')