FranciscoLozDataScience commited on
Commit
1e7edfa
·
1 Parent(s): c7e6fe9

moved the example array

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -38,9 +38,19 @@ def load_interface():
38
  '''
39
  Configure Gradio interface
40
  '''
 
 
 
 
 
 
 
 
 
 
41
  #set blocks
42
  info_page = gr.Blocks()
43
- model_page = gr.Blocks()
44
 
45
  with info_page:
46
  # set title and description
@@ -142,15 +152,6 @@ def load_interface():
142
  pred_btn.click(fn=predict, inputs=inputs, outputs=smoker_label)
143
  clear_btn.click(lambda: [None]*22, outputs=inputs)
144
 
145
- #add examples
146
- examples= [
147
- [20,85,135,190,30,125,53,126,0.1,9.9,0.1,9.9,1,2,1,2,79,240,40,140,55,505,72,371,16,405,4,618,1,1660,4.9,20.9,1,6,0.1,10.3,6,1311,1,2062,1,999,0,1],
148
- [40,170,65,75.1,1.0,0.9,1,1,120,70,102,225,260,41,132,15.7,1,0.8,24,26,32,0,45,170,75,89.0,0.7,1.2,1,1,100,67,96,258,345,49,140,15.7,1,1.1,26,28,138,0,30],
149
- [180,90,94.0,1.0,0.8,1,1,115,72,88,177,103,53,103,13.5,1,1.0,19,29,30,0,60,170,65,78.0,1.5,1.0,1,1,110,70,87,190,210,45,103,14.7,1,0.8,21,21,19,0,55],
150
- [175,60,75.0,1.0,1.0,1,1,100,64,93,186,80,86,84,15.4,3,1.0,39,20,35,0,40,160,55,69.0,1.5,1.5,1,1,112,78,90,177,68,78,85,12.4,1,0.5,15,9,14,0,55],
151
- [175,60,80.0,1.2,1.5,1.5,1,1,137,89,80,199,35,68,124,16.0,1,1.1,23,19,17,0,55,160,50,68.0,0.8,0.5,1,1,137,87,90,176,36,67,102,13.6,1,0.7,15,14,13,0]
152
- ]
153
-
154
  iface = gr.TabbedInterface(
155
  [info_page, model_page],
156
  ["Information", "Smoker Model"]
 
38
  '''
39
  Configure Gradio interface
40
  '''
41
+
42
+ #add examples
43
+ ex= [
44
+ [20,85,135,190,30,125,53,126,0.1,9.9,0.1,9.9,1,2,1,2,79,240,40,140,55,505,72,371,16,405,4,618,1,1660,4.9,20.9,1,6,0.1,10.3,6,1311,1,2062,1,999,0,1],
45
+ [40,170,65,75.1,1.0,0.9,1,1,120,70,102,225,260,41,132,15.7,1,0.8,24,26,32,0,45,170,75,89.0,0.7,1.2,1,1,100,67,96,258,345,49,140,15.7,1,1.1,26,28,138,0,30],
46
+ [180,90,94.0,1.0,0.8,1,1,115,72,88,177,103,53,103,13.5,1,1.0,19,29,30,0,60,170,65,78.0,1.5,1.0,1,1,110,70,87,190,210,45,103,14.7,1,0.8,21,21,19,0,55],
47
+ [175,60,75.0,1.0,1.0,1,1,100,64,93,186,80,86,84,15.4,3,1.0,39,20,35,0,40,160,55,69.0,1.5,1.5,1,1,112,78,90,177,68,78,85,12.4,1,0.5,15,9,14,0,55],
48
+ [175,60,80.0,1.2,1.5,1.5,1,1,137,89,80,199,35,68,124,16.0,1,1.1,23,19,17,0,55,160,50,68.0,0.8,0.5,1,1,137,87,90,176,36,67,102,13.6,1,0.7,15,14,13,0]
49
+ ]
50
+
51
  #set blocks
52
  info_page = gr.Blocks()
53
+ model_page = gr.Blocks(examples=ex)
54
 
55
  with info_page:
56
  # set title and description
 
152
  pred_btn.click(fn=predict, inputs=inputs, outputs=smoker_label)
153
  clear_btn.click(lambda: [None]*22, outputs=inputs)
154
 
 
 
 
 
 
 
 
 
 
155
  iface = gr.TabbedInterface(
156
  [info_page, model_page],
157
  ["Information", "Smoker Model"]