Bofandra commited on
Commit
30e3fcc
1 Parent(s): 22855ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -52,6 +52,7 @@ def respond(message,
52
  for index, row in sorted_references.iterrows():
53
  if(type(row["user"]) is str and type(row['assistant']) is str):
54
  try:
 
55
  print(index)
56
  print(f'{row["user"]}')
57
  translated = translator.translate(f'{row["user"]}', src='ar', dest='en')
@@ -91,6 +92,7 @@ def respond(message,
91
  print(message)
92
  print("============")
93
  try:
 
94
  print(translator.detect(message))
95
  message_language = translator.detect(message).lang
96
  print(message_language)
 
52
  for index, row in sorted_references.iterrows():
53
  if(type(row["user"]) is str and type(row['assistant']) is str):
54
  try:
55
+ translator = Translator()
56
  print(index)
57
  print(f'{row["user"]}')
58
  translated = translator.translate(f'{row["user"]}', src='ar', dest='en')
 
92
  print(message)
93
  print("============")
94
  try:
95
+ translator = Translator()
96
  print(translator.detect(message))
97
  message_language = translator.detect(message).lang
98
  print(message_language)