Update app.py
Browse files
app.py
CHANGED
@@ -47,7 +47,7 @@ def translate_text(text):
|
|
47 |
if detected_language == "en":
|
48 |
return "The text is already in English."
|
49 |
|
50 |
-
chunks = [text[i:i +
|
51 |
translated_text = ""
|
52 |
for chunk in chunks:
|
53 |
translated_chunk = translator(chunk, max_length=400)
|
|
|
47 |
if detected_language == "en":
|
48 |
return "The text is already in English."
|
49 |
|
50 |
+
chunks = [text[i:i + 15000] for i in range(0, len(text), 15000)]
|
51 |
translated_text = ""
|
52 |
for chunk in chunks:
|
53 |
translated_chunk = translator(chunk, max_length=400)
|