Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -70,14 +70,15 @@ with gr.Blocks(theme="soft") as demo:
|
|
70 |
("الصبار", "Arabic"),
|
71 |
]
|
72 |
|
|
|
|
|
|
|
73 |
with gr.Row():
|
74 |
for name, lang in example_plants:
|
75 |
example_button = gr.Button(f"🌿 {name} ({lang})")
|
76 |
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
example_button.click(fill_plant_name, outputs=plant_name_input)
|
81 |
|
82 |
classify_button = gr.Button("🔍 Get Plant Info", variant="primary")
|
83 |
classify_button.click(generate_plant_info, inputs=[plant_name_input, language_selector], outputs=output_text)
|
|
|
70 |
("الصبار", "Arabic"),
|
71 |
]
|
72 |
|
73 |
+
def update_inputs(plant_name, language):
|
74 |
+
return plant_name, language
|
75 |
+
|
76 |
with gr.Row():
|
77 |
for name, lang in example_plants:
|
78 |
example_button = gr.Button(f"🌿 {name} ({lang})")
|
79 |
|
80 |
+
example_button.click(update_inputs, inputs=[], outputs=[plant_name_input, language_selector],
|
81 |
+
queue=False, _fn_args={"plant_name": name, "language": lang})
|
|
|
|
|
82 |
|
83 |
classify_button = gr.Button("🔍 Get Plant Info", variant="primary")
|
84 |
classify_button.click(generate_plant_info, inputs=[plant_name_input, language_selector], outputs=output_text)
|