Bofandra commited on
Commit
74b2ca0
1 Parent(s): b507850

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -115,11 +115,14 @@ def respond(
115
 
116
  response += token
117
 
118
- #translated_response = translator.translate(response, src='en', dest=message_language)
119
- #if(translated_response.text):
120
- # yield translated_response.text
121
- #else:
122
- yield response
 
 
 
123
 
124
 
125
  """
 
115
 
116
  response += token
117
 
118
+ if(len(token)==0 and message_language!='en'):
119
+ translated_response = translator.translate(response, src='en', dest=message_language)
120
+ if(translated_response and translated_response.text):
121
+ yield translated_response.text
122
+ else:
123
+ yield response
124
+ else:
125
+ yield response
126
 
127
 
128
  """