Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -77,8 +77,9 @@ with gr.Blocks(theme="soft") as demo:
|
|
77 |
for name, lang in example_plants:
|
78 |
example_button = gr.Button(f"🌿 {name} ({lang})")
|
79 |
|
80 |
-
|
81 |
-
|
|
|
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)
|
|
|
77 |
for name, lang in example_plants:
|
78 |
example_button = gr.Button(f"🌿 {name} ({lang})")
|
79 |
|
80 |
+
# Use lambda to pass the arguments directly
|
81 |
+
example_button.click(lambda plant_name=name, language=lang: update_inputs(plant_name, language),
|
82 |
+
outputs=[plant_name_input, language_selector])
|
83 |
|
84 |
classify_button = gr.Button("🔍 Get Plant Info", variant="primary")
|
85 |
classify_button.click(generate_plant_info, inputs=[plant_name_input, language_selector], outputs=output_text)
|