Spaces:
Sleeping
Sleeping
Sanzana Lora
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ iface = gr.Interface(
|
|
40 |
fn=translate_text, # Placeholder function; will be updated dynamically based on task selection
|
41 |
inputs=gr.Textbox("textarea", label="Input Text"),
|
42 |
outputs=gr.Textbox("auto", label="Output Text"),
|
43 |
-
live=
|
44 |
)
|
45 |
|
46 |
# Function to update the Gradio interface based on task selection
|
@@ -57,12 +57,9 @@ def update_interface(change):
|
|
57 |
# Dropdown widget to select the task
|
58 |
task_selector = gr.Dropdown(
|
59 |
["Translate", "Summarize", "Paraphrase"],
|
60 |
-
default="Translate",
|
61 |
label="Select Task"
|
62 |
)
|
63 |
|
64 |
-
# Attach the update function to the dropdown widget
|
65 |
-
task_selector.observe(update_interface, names='value')
|
66 |
|
67 |
# Launch the Gradio app
|
68 |
-
iface.launch()
|
|
|
40 |
fn=translate_text, # Placeholder function; will be updated dynamically based on task selection
|
41 |
inputs=gr.Textbox("textarea", label="Input Text"),
|
42 |
outputs=gr.Textbox("auto", label="Output Text"),
|
43 |
+
live=False
|
44 |
)
|
45 |
|
46 |
# Function to update the Gradio interface based on task selection
|
|
|
57 |
# Dropdown widget to select the task
|
58 |
task_selector = gr.Dropdown(
|
59 |
["Translate", "Summarize", "Paraphrase"],
|
|
|
60 |
label="Select Task"
|
61 |
)
|
62 |
|
|
|
|
|
63 |
|
64 |
# Launch the Gradio app
|
65 |
+
iface.launch(inline=False)
|