fruitpicker01 commited on
Commit
cbd104c
1 Parent(s): 17c86fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -21,17 +21,19 @@ def success_rate_gauge(success_value):
21
  # Gradio interface
22
  with gr.Blocks() as demo:
23
  gr.Markdown("## Улучшенный спидометр с вероятностью успеха")
24
-
25
- # Add a plot output widget
26
  plot = gr.Plot(label="Success Rate Gauge")
27
-
28
  # Function to update the plot
29
  def update_plot():
30
  return success_rate_gauge(76)
31
 
32
- # Button to trigger the update
33
- with gr.Row():
34
- plot.render(update_plot())
35
 
36
- # Launch Gradio interface
 
 
 
37
  demo.launch()
 
21
  # Gradio interface
22
  with gr.Blocks() as demo:
23
  gr.Markdown("## Улучшенный спидометр с вероятностью успеха")
24
+
25
+ # Plot output
26
  plot = gr.Plot(label="Success Rate Gauge")
27
+
28
  # Function to update the plot
29
  def update_plot():
30
  return success_rate_gauge(76)
31
 
32
+ # Button to trigger the plot generation
33
+ btn = gr.Button("Показать спидометр")
 
34
 
35
+ # Associate the button with the update function
36
+ btn.click(fn=update_plot, inputs=[], outputs=plot)
37
+
38
+ # Launch Gradio interface
39
  demo.launch()