Spaces:
Build error
Build error
Update app.py
Browse files45 unmodified lines46474849495051525354505152535455565657575859596060616263646566676862636465666768697069707145 unmodified lines
# Gradio app definitiondef app(): with gr.Blocks(title="Dynamic Menu with Preferences") as demo: # Radio button for selecting preference selected_preference = gr.Radio( choices=["All", "Vegan", "Halal", "Guilt-Free"], value="All", label="Choose a Preference", ) # Radio button for selecting preference selected_preference = gr.Radio( choices=["All", "Vegan", "Halal", "Guilt-Free"], value="All", label="Choose a Preference", )
# Output area for menu items menu_output = gr.HTML(value=filter_menu("All")) # Output area for menu items menu_output = gr.HTML(value=filter_menu("All"))
# Set up Gradio interface selected_preference.change(filter_menu, inputs=[selected_preference], outputs=[menu_output]) # Define interactivity selected_preference.change(filter_menu, inputs=[selected_preference], outputs=[menu_output])
# Layout gr.Markdown("## Dynamic Menu with Preferences") with gr.Row(): selected_preference.render() menu_output.render()
# Layout definition demo = gr.Interface( fn=None, inputs=[selected_preference], outputs=[menu_output], live=True, title="Dynamic Menu with Preferences", theme="default", ) return demo
# Run the appapp.py+17-19