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

first version improved

Browse files
Files changed (3) hide show
  1. app.py +22 -3
  2. models/simple_model.pkl +3 -0
  3. requirements.txt +34 -2
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import gradio as gr
2
  import pandas as pd
3
  import random
 
4
 
5
  data = pd.read_pickle("merged_all_table.pkl", compression='bz2')
6
 
@@ -8,13 +9,19 @@ 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(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
 
@@ -59,6 +66,17 @@ with gr.Blocks() as demo:
59
  multiselect=False,
60
  )
61
 
 
 
 
 
 
 
 
 
 
 
 
62
  with gr.Row():
63
  predict_btn = gr.Button(value="Predict")
64
 
@@ -70,6 +88,7 @@ with gr.Blocks() as demo:
70
  inputs=[
71
  dd_home_team,
72
  dd_away_team,
 
73
  ],
74
  outputs=[Answer],
75
  )
 
1
  import gradio as gr
2
  import pandas as pd
3
  import random
4
+ import keras.models as km
5
 
6
  data = pd.read_pickle("merged_all_table.pkl", compression='bz2')
7
 
 
9
  away_team_id = sorted(data["away_team_long_name"].unique())
10
 
11
 
12
+ def predict(Home_team, Away_team, Model_name):
13
 
14
  if Home_team == "":
15
+ raise gr.Error("Home Team is required, Please Select The Home Team!")
16
 
17
  if Away_team == "":
18
+ raise gr.Error("Away Team is required, Please Select The Away Team!")
19
+
20
+ if Model_name == "":
21
+ raise gr.Error("Model is required, Please Select The Model!")
22
+
23
+ if Model_name == "Simple Model":
24
+ model = km.load_model('models/simple_model.pkl')
25
 
26
  return "Model is in under construction 🛠️🚜"
27
 
 
66
  multiselect=False,
67
  )
68
 
69
+ with gr.Row():
70
+
71
+ with gr.Column():
72
+
73
+ dd_model = gr.Dropdown(
74
+ label="Model ( Feature Under Construction 🚧 )",
75
+ choices=["Simple Model"],
76
+ info="Select Your Model:",
77
+ multiselect=False,
78
+ )
79
+
80
  with gr.Row():
81
  predict_btn = gr.Button(value="Predict")
82
 
 
88
  inputs=[
89
  dd_home_team,
90
  dd_away_team,
91
+ dd_model,
92
  ],
93
  outputs=[Answer],
94
  )
models/simple_model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:646659c40f96f43be2e15e1e472f6c8fe4198e4d8c35202becef888c96d50389
3
+ size 2204975
requirements.txt CHANGED
@@ -1,11 +1,14 @@
 
1
  aiofiles==23.1.0
2
  aiohttp==3.8.5
3
  aiosignal==1.3.1
4
  altair==5.0.1
5
  annotated-types==0.5.0
6
  anyio==3.7.1
 
7
  async-timeout==4.0.2
8
  attrs==23.1.0
 
9
  certifi==2023.7.22
10
  charset-normalizer==3.2.0
11
  click==8.1.6
@@ -15,34 +18,50 @@ exceptiongroup==1.1.2
15
  fastapi==0.100.1
16
  ffmpy==0.3.1
17
  filelock==3.12.2
 
18
  fonttools==4.41.1
19
  frozenlist==1.4.0
20
  fsspec==2023.6.0
 
 
 
 
21
  gradio==3.39.0
22
  gradio_client==0.3.0
 
23
  h11==0.14.0
 
24
  httpcore==0.17.3
25
  httpx==0.24.1
26
  huggingface-hub==0.16.4
27
  idna==3.4
28
  install==1.3.5
29
  Jinja2==3.1.2
 
30
  jsonschema==4.18.4
31
  jsonschema-specifications==2023.7.1
 
32
  kiwisolver==1.4.4
 
33
  linkify-it-py==2.0.2
 
34
  markdown-it-py==2.2.0
35
  MarkupSafe==2.1.3
36
  matplotlib==3.7.2
37
  mdit-py-plugins==0.3.3
38
  mdurl==0.1.2
39
  multidict==6.0.4
40
- numpy==1.25.1
 
 
41
  orjson==3.9.2
42
  packaging==23.1
43
  pandas==2.0.3
44
  Pillow==10.0.0
45
  polars==0.18.9
 
 
 
46
  pydantic==2.1.1
47
  pydantic_core==2.4.0
48
  pydub==0.25.1
@@ -53,17 +72,30 @@ pytz==2023.3
53
  PyYAML==6.0.1
54
  referencing==0.30.0
55
  requests==2.31.0
 
56
  rpds-py==0.9.2
 
 
 
57
  semantic-version==2.10.0
58
  six==1.16.0
59
  sniffio==1.3.0
60
  starlette==0.27.0
 
 
 
 
 
 
 
61
  toolz==0.12.0
62
  tqdm==4.65.0
63
  typing_extensions==4.7.1
64
  tzdata==2023.3
65
  uc-micro-py==1.0.2
66
- urllib3==2.0.4
67
  uvicorn==0.23.1
68
  websockets==11.0.3
 
 
69
  yarl==1.9.2
 
1
+ absl-py==1.4.0
2
  aiofiles==23.1.0
3
  aiohttp==3.8.5
4
  aiosignal==1.3.1
5
  altair==5.0.1
6
  annotated-types==0.5.0
7
  anyio==3.7.1
8
+ astunparse==1.6.3
9
  async-timeout==4.0.2
10
  attrs==23.1.0
11
+ cachetools==5.3.1
12
  certifi==2023.7.22
13
  charset-normalizer==3.2.0
14
  click==8.1.6
 
18
  fastapi==0.100.1
19
  ffmpy==0.3.1
20
  filelock==3.12.2
21
+ flatbuffers==23.5.26
22
  fonttools==4.41.1
23
  frozenlist==1.4.0
24
  fsspec==2023.6.0
25
+ gast==0.4.0
26
+ google-auth==2.22.0
27
+ google-auth-oauthlib==1.0.0
28
+ google-pasta==0.2.0
29
  gradio==3.39.0
30
  gradio_client==0.3.0
31
+ grpcio==1.56.2
32
  h11==0.14.0
33
+ h5py==3.9.0
34
  httpcore==0.17.3
35
  httpx==0.24.1
36
  huggingface-hub==0.16.4
37
  idna==3.4
38
  install==1.3.5
39
  Jinja2==3.1.2
40
+ joblib==1.3.1
41
  jsonschema==4.18.4
42
  jsonschema-specifications==2023.7.1
43
+ keras==2.13.1
44
  kiwisolver==1.4.4
45
+ libclang==16.0.6
46
  linkify-it-py==2.0.2
47
+ Markdown==3.4.4
48
  markdown-it-py==2.2.0
49
  MarkupSafe==2.1.3
50
  matplotlib==3.7.2
51
  mdit-py-plugins==0.3.3
52
  mdurl==0.1.2
53
  multidict==6.0.4
54
+ numpy==1.24.3
55
+ oauthlib==3.2.2
56
+ opt-einsum==3.3.0
57
  orjson==3.9.2
58
  packaging==23.1
59
  pandas==2.0.3
60
  Pillow==10.0.0
61
  polars==0.18.9
62
+ protobuf==4.23.4
63
+ pyasn1==0.5.0
64
+ pyasn1-modules==0.3.0
65
  pydantic==2.1.1
66
  pydantic_core==2.4.0
67
  pydub==0.25.1
 
72
  PyYAML==6.0.1
73
  referencing==0.30.0
74
  requests==2.31.0
75
+ requests-oauthlib==1.3.1
76
  rpds-py==0.9.2
77
+ rsa==4.9
78
+ scikit-learn==1.3.0
79
+ scipy==1.11.1
80
  semantic-version==2.10.0
81
  six==1.16.0
82
  sniffio==1.3.0
83
  starlette==0.27.0
84
+ tensorboard==2.13.0
85
+ tensorboard-data-server==0.7.1
86
+ tensorflow==2.13.0
87
+ tensorflow-estimator==2.13.0
88
+ tensorflow-macos==2.13.0
89
+ termcolor==2.3.0
90
+ threadpoolctl==3.2.0
91
  toolz==0.12.0
92
  tqdm==4.65.0
93
  typing_extensions==4.7.1
94
  tzdata==2023.3
95
  uc-micro-py==1.0.2
96
+ urllib3==1.26.16
97
  uvicorn==0.23.1
98
  websockets==11.0.3
99
+ Werkzeug==2.3.6
100
+ wrapt==1.15.0
101
  yarl==1.9.2