Update app.py
Browse files
app.py
CHANGED
@@ -82,7 +82,7 @@ def hf_inference_translate(prompt="Wie kann ich Ihnen helfen?", target_language
|
|
82 |
# Get the input language
|
83 |
chat_response_languagedetected = ""
|
84 |
chat_response_languagedetected = api.language_detection(text)
|
85 |
-
print(chat_response_languagedetected[0][0])
|
86 |
# Translate based on input prompt, detected language and chosen target language
|
87 |
text_translation_response = api.text_translation(prompt, chat_response_languagedetected[0][0]['label'], target_language)
|
88 |
print(text_translation_response)
|
@@ -107,7 +107,7 @@ iface = gr.Interface(
|
|
107 |
fn=hf_inference_translate,
|
108 |
inputs=[
|
109 |
gr.inputs.Textbox(label="Input", lines=5, placeholder="Enter text to translate"),
|
110 |
-
gr.inputs.Dropdown(["en", "fr", "de", "es", "
|
111 |
],
|
112 |
outputs=[
|
113 |
gr.outputs.Textbox(label="Translated text"),
|
|
|
82 |
# Get the input language
|
83 |
chat_response_languagedetected = ""
|
84 |
chat_response_languagedetected = api.language_detection(text)
|
85 |
+
print(chat_response_languagedetected[0][0]['label'])
|
86 |
# Translate based on input prompt, detected language and chosen target language
|
87 |
text_translation_response = api.text_translation(prompt, chat_response_languagedetected[0][0]['label'], target_language)
|
88 |
print(text_translation_response)
|
|
|
107 |
fn=hf_inference_translate,
|
108 |
inputs=[
|
109 |
gr.inputs.Textbox(label="Input", lines=5, placeholder="Enter text to translate"),
|
110 |
+
gr.inputs.Dropdown(["en", "fr", "de", "es", "ru"], label="Select target language")
|
111 |
],
|
112 |
outputs=[
|
113 |
gr.outputs.Textbox(label="Translated text"),
|