Yaron Koresh commited on
Commit
ce70084
·
verified ·
1 Parent(s): ee47803

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -728,7 +728,7 @@ def translate(txt,to_lang="en",from_lang=False):
728
  words = txt.split()
729
  while len(words) > 0:
730
  chunk = ""
731
- while len(chunk) < 490:
732
  chunk = chunk + " " + words[0]
733
  words = words[1:]
734
  if len(chunk) > 490:
 
728
  words = txt.split()
729
  while len(words) > 0:
730
  chunk = ""
731
+ while len(words) > 0 and len(chunk) < 490:
732
  chunk = chunk + " " + words[0]
733
  words = words[1:]
734
  if len(chunk) > 490: