zeel sheladiya commited on
Commit
78add90
·
1 Parent(s): 03ecc94

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -17
app.py CHANGED
@@ -8,18 +8,15 @@ home_team_id = sorted(data["home_team_long_name"].unique())
8
  away_team_id = sorted(data["away_team_long_name"].unique())
9
 
10
 
11
- def predict(*args):
12
- # TODO: need to complete the function
13
- # if str(home_team_id.value) == None:
14
- # print(str(home_team_id.value))
15
- # raise gr.Error("Home Team is required")
16
 
17
- # if str(Away_team_id.value) == None:
18
- # raise gr.Error("Away Team is required")
19
 
20
- # print(str(home_team_id.value))
21
- # return str(home_team_id.value)
22
- return "None"
23
 
24
  # markup table for markdown
25
  # # Members:
@@ -46,18 +43,20 @@ with gr.Blocks() as demo:
46
  with gr.Row():
47
  with gr.Column():
48
 
49
- home_team_id = gr.Dropdown(
50
  label="Home Team",
51
  choices=home_team_id,
52
- max_choices=1,
 
53
  )
54
 
55
  with gr.Column():
56
-
57
- Away_team_id = gr.Dropdown(
58
  label="Away Team",
59
  choices=away_team_id,
60
- max_choices=1,
 
61
  )
62
 
63
  with gr.Row():
@@ -69,8 +68,8 @@ with gr.Blocks() as demo:
69
  predict_btn.click(
70
  predict,
71
  inputs=[
72
- home_team_id,
73
- Away_team_id,
74
  ],
75
  outputs=[Answer],
76
  )
 
8
  away_team_id = sorted(data["away_team_long_name"].unique())
9
 
10
 
11
+ def predict(Home_team, Away_team):
12
+
13
+ if Home_team == "":
14
+ raise gr.Error("Home Team is required")
 
15
 
16
+ if Away_team == "":
17
+ raise gr.Error("Away Team is required")
18
 
19
+ return "Model is in under construction 🛠️🚜"
 
 
20
 
21
  # markup table for markdown
22
  # # Members:
 
43
  with gr.Row():
44
  with gr.Column():
45
 
46
+ dd_home_team = gr.Dropdown(
47
  label="Home Team",
48
  choices=home_team_id,
49
+ info="Select Your Home Team:",
50
+ multiselect=False,
51
  )
52
 
53
  with gr.Column():
54
+
55
+ dd_away_team = gr.Dropdown(
56
  label="Away Team",
57
  choices=away_team_id,
58
+ info="Select Your Away Team:",
59
+ multiselect=False,
60
  )
61
 
62
  with gr.Row():
 
68
  predict_btn.click(
69
  predict,
70
  inputs=[
71
+ dd_home_team,
72
+ dd_away_team,
73
  ],
74
  outputs=[Answer],
75
  )