vasu0508 commited on
Commit
e20b8ee
1 Parent(s): 4fd1c71

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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
- detected_language=Detector(text,quiet=True).language.code
 
 
 
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