matheuscvp commited on
Commit
118c394
·
1 Parent(s): 3c882df

update order of variables

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -4,10 +4,10 @@ import skimage
4
  import pickle
5
 
6
  default_columns = [
7
- 'wind',
8
  'temp_max',
9
  'temp_min',
10
- 'precipitation',
11
  ]
12
 
13
  options = [
@@ -23,16 +23,16 @@ with open("model.pkl", "rb") as f:
23
 
24
 
25
  def predict(wind, temp_max, temp_min, precipitation):
26
- f_wind = float(wind)
27
  f_max_temp = float(temp_max)
28
  f_min_temp = float(temp_min)
29
- f_precipitation = float(precipitation)
30
 
31
  default = [
32
- f_wind,
33
  f_max_temp,
34
  f_min_temp,
35
- f_precipitation,
36
  ]
37
 
38
  df = pd.DataFrame([default], columns=default_columns)
@@ -46,10 +46,10 @@ iface = gr.Interface(
46
  title="Weather Prediction",
47
  allow_flagging="never",
48
  inputs=[
49
- gr.inputs.Slider(0, 10, default=5, label="wind"),
50
  gr.inputs.Slider(-10, 40, default=20, label="temp_max"),
51
  gr.inputs.Slider(-10, 40, default=10, label="temp_min"),
52
- gr.inputs.Slider(0, 60, default=30, label="precipitation"),
53
  ],
54
  outputs="text",
55
  )
 
4
  import pickle
5
 
6
  default_columns = [
7
+ 'precipitation',
8
  'temp_max',
9
  'temp_min',
10
+ 'wind',
11
  ]
12
 
13
  options = [
 
23
 
24
 
25
  def predict(wind, temp_max, temp_min, precipitation):
26
+ f_precipitation = float(precipitation)
27
  f_max_temp = float(temp_max)
28
  f_min_temp = float(temp_min)
29
+ f_wind = float(wind)
30
 
31
  default = [
32
+ f_precipitation,
33
  f_max_temp,
34
  f_min_temp,
35
+ f_wind,
36
  ]
37
 
38
  df = pd.DataFrame([default], columns=default_columns)
 
46
  title="Weather Prediction",
47
  allow_flagging="never",
48
  inputs=[
49
+ gr.inputs.Slider(0, 60, default=30, label="precipitation"),
50
  gr.inputs.Slider(-10, 40, default=20, label="temp_max"),
51
  gr.inputs.Slider(-10, 40, default=10, label="temp_min"),
52
+ gr.inputs.Slider(0, 10, default=5, label="wind"),
53
  ],
54
  outputs="text",
55
  )