Spaces:
Running
Running
zeel sheladiya
commited on
Commit
·
3e17301
1
Parent(s):
d7f4161
Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,8 @@ import random
|
|
4 |
|
5 |
data = pd.read_pickle("merged_all_table.pkl", compression='bz2')
|
6 |
|
7 |
-
home_team_id =
|
8 |
-
away_team_id =
|
9 |
|
10 |
|
11 |
def predict(*args):
|
@@ -40,7 +40,7 @@ with gr.Blocks() as demo:
|
|
40 |
label="Home Team",
|
41 |
choices=home_team_id,
|
42 |
max_choices=1,
|
43 |
-
|
44 |
)
|
45 |
|
46 |
with gr.Column():
|
@@ -49,7 +49,7 @@ with gr.Blocks() as demo:
|
|
49 |
label="Away Team",
|
50 |
choices=away_team_id,
|
51 |
max_choices=1,
|
52 |
-
|
53 |
)
|
54 |
|
55 |
with gr.Row():
|
|
|
4 |
|
5 |
data = pd.read_pickle("merged_all_table.pkl", compression='bz2')
|
6 |
|
7 |
+
home_team_id = sorted(data["team_long_name"].unique())
|
8 |
+
away_team_id = sorted(data["team_long_name"].unique())
|
9 |
|
10 |
|
11 |
def predict(*args):
|
|
|
40 |
label="Home Team",
|
41 |
choices=home_team_id,
|
42 |
max_choices=1,
|
43 |
+
value=lambda: random.choice(home_team_id),
|
44 |
)
|
45 |
|
46 |
with gr.Column():
|
|
|
49 |
label="Away Team",
|
50 |
choices=away_team_id,
|
51 |
max_choices=1,
|
52 |
+
value=lambda: random.choice(away_team_id),
|
53 |
)
|
54 |
|
55 |
with gr.Row():
|