| import gradio as gr | |
| def test_button(name): | |
| return f"Button {name} clicked! The server is alive." | |
| with gr.Blocks() as demo: | |
| gr.Markdown("# Dependency Test Space") | |
| gr.Markdown("If you can see this, the Hugging Face Proxy is working correctly.") | |
| with gr.Row(): | |
| btn1 = gr.Button("Test A") | |
| btn2 = gr.Button("Test B") | |
| output = gr.Textbox(label="Status Window") | |
| btn1.click(fn=test_button, inputs=[gr.State("A")], outputs=output) | |
| btn2.click(fn=test_button, inputs=[gr.State("B")], outputs=output) | |
| demo.queue().launch(server_name="0.0.0.0", server_port=7860, ssr_mode=False) |