Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -83,7 +83,10 @@ with gr.Blocks() as meena:
|
|
83 |
print(step)
|
84 |
if step!=0:
|
85 |
chat_history_ids=get()
|
86 |
-
|
|
|
|
|
|
|
87 |
translator=Translator(from_lang=detected_language,to_lang="en")
|
88 |
translated_input=translator.translate(text)
|
89 |
# encode the input and add end of string token
|
|
|
83 |
print(step)
|
84 |
if step!=0:
|
85 |
chat_history_ids=get()
|
86 |
+
if text.isdigit():
|
87 |
+
detected_language='en'
|
88 |
+
else:
|
89 |
+
detected_language=Detector(text,quiet=True).language.code
|
90 |
translator=Translator(from_lang=detected_language,to_lang="en")
|
91 |
translated_input=translator.translate(text)
|
92 |
# encode the input and add end of string token
|