jack-donlan commited on
Commit
e13b1fa
·
verified ·
1 Parent(s): 580140d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -3
app.py CHANGED
@@ -69,9 +69,22 @@ with gr.Blocks(title = title) as demo:
69
  [label,local_plot], api_name="Employee_Turnover"
70
  )
71
 
 
 
 
 
 
 
 
 
72
  gr.Markdown('### Click on any of the examples below to see how it works:')
73
- gr.Examples([[3.7,3.1,3.1,3.3,3.1,2.9,3.1], [3.7,3.1,5.0,5.0,3.1,5.0,3.1], [4.2,3.8,4.0,4.1,3.8,4.0,4.0], [4.2,3.8,5.0,5.0,3.8,5.0,4.0]],
74
- [PassionateAtWork,Workload,SupportiveGM,WorkEnvironment,Informed,LearningDevelopment,JobSecurity],
75
- [label,local_plot], main_func, cache_examples=True)
 
 
 
 
 
76
 
77
  demo.launch()
 
69
  [label,local_plot], api_name="Employee_Turnover"
70
  )
71
 
72
+ example_titles = ["Example 1: Balanced", "Example 2: High Variation", "Example 3: Moderate", "Example 4: Extreme"]
73
+ example_values = [
74
+ [3.7,3.1,3.1,3.3,3.1,2.9,3.1],
75
+ [3.7,3.1,5.0,5.0,3.1,5.0,3.1],
76
+ [4.2,3.8,4.0,4.1,3.8,4.0,4.0],
77
+ [4.2,3.8,5.0,5.0,3.8,5.0,4.0]]
78
+
79
+ with gr.Blocks() as demo:
80
  gr.Markdown('### Click on any of the examples below to see how it works:')
81
+
82
+ inputs = [gr.Number(label=name) for name in
83
+ ["PassionateAtWork", "Workload", "SupportiveGM", "WorkEnvironment", "Informed", "LearningDevelopment", "JobSecurity"]]
84
+
85
+ output = gr.Label() # You can adjust this to match your main function output type
86
+
87
+ for title, values in zip(example_titles, example_values):
88
+ gr.Button(title).click(set_values, values, inputs)
89
 
90
  demo.launch()