Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -39,14 +39,14 @@ language_options = [
|
|
39 |
language_dropdown_options = [(code, f"{name} ({code})") for code, name in language_options]
|
40 |
|
41 |
# Create dropdowns for source and target languages
|
42 |
-
source_language_dropdown = gr.
|
43 |
-
target_language_dropdown = gr.
|
44 |
|
45 |
# Define the interface
|
46 |
iface = gr.Interface(
|
47 |
fn=translate_text,
|
48 |
-
inputs=[gr.
|
49 |
-
outputs=gr.
|
50 |
title="Text Translator with Dynamic Helsinki NLP Models",
|
51 |
description="Select source and target languages to translate text using Helsinki NLP models."
|
52 |
)
|
|
|
39 |
language_dropdown_options = [(code, f"{name} ({code})") for code, name in language_options]
|
40 |
|
41 |
# Create dropdowns for source and target languages
|
42 |
+
source_language_dropdown = gr.Dropdown(choices=language_dropdown_options, label="Source Language")
|
43 |
+
target_language_dropdown = gr.Dropdown(choices=language_dropdown_options, label="Target Language")
|
44 |
|
45 |
# Define the interface
|
46 |
iface = gr.Interface(
|
47 |
fn=translate_text,
|
48 |
+
inputs=[gr.Textbox(lines=2, placeholder="Enter text to translate..."), source_language_dropdown, target_language_dropdown],
|
49 |
+
outputs=gr.Textbox(),
|
50 |
title="Text Translator with Dynamic Helsinki NLP Models",
|
51 |
description="Select source and target languages to translate text using Helsinki NLP models."
|
52 |
)
|