Spaces:
Sleeping
Sleeping
jeremierostan
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -347,9 +347,9 @@ def create_gradio_interface():
|
|
347 |
user_text = input_text
|
348 |
lang_code = predict_language(user_text)
|
349 |
|
350 |
-
#
|
351 |
lang_name = LID_LANGUAGES.get(lang_code, "Unknown")
|
352 |
-
|
353 |
|
354 |
# Generate response
|
355 |
new_history, response, new_conv_id = conversation_manager.generate_response(
|
@@ -362,7 +362,7 @@ def create_gradio_interface():
|
|
362 |
except ValueError as e:
|
363 |
raise gr.Error(str(e))
|
364 |
|
365 |
-
return new_history, new_conv_id, audio_path
|
366 |
|
367 |
# Connect event handlers
|
368 |
submit_btn.click(
|
@@ -377,7 +377,8 @@ def create_gradio_interface():
|
|
377 |
outputs=[
|
378 |
chatbot,
|
379 |
conversation_id,
|
380 |
-
response_audio
|
|
|
381 |
]
|
382 |
)
|
383 |
|
@@ -394,7 +395,8 @@ def create_gradio_interface():
|
|
394 |
outputs=[
|
395 |
chatbot,
|
396 |
conversation_id,
|
397 |
-
response_audio
|
|
|
398 |
]
|
399 |
)
|
400 |
|
|
|
347 |
user_text = input_text
|
348 |
lang_code = predict_language(user_text)
|
349 |
|
350 |
+
# Get language name
|
351 |
lang_name = LID_LANGUAGES.get(lang_code, "Unknown")
|
352 |
+
language_info = f"Detected Language: {lang_name}"
|
353 |
|
354 |
# Generate response
|
355 |
new_history, response, new_conv_id = conversation_manager.generate_response(
|
|
|
362 |
except ValueError as e:
|
363 |
raise gr.Error(str(e))
|
364 |
|
365 |
+
return new_history, new_conv_id, audio_path, language_info
|
366 |
|
367 |
# Connect event handlers
|
368 |
submit_btn.click(
|
|
|
377 |
outputs=[
|
378 |
chatbot,
|
379 |
conversation_id,
|
380 |
+
response_audio,
|
381 |
+
detected_language
|
382 |
]
|
383 |
)
|
384 |
|
|
|
395 |
outputs=[
|
396 |
chatbot,
|
397 |
conversation_id,
|
398 |
+
response_audio,
|
399 |
+
detected_language
|
400 |
]
|
401 |
)
|
402 |
|