zeel sheladiya
Update app.py
03ecc94
raw
history blame
2.38 kB
import gradio as gr
import pandas as pd
import random
data = pd.read_pickle("merged_all_table.pkl", compression='bz2')
home_team_id = sorted(data["home_team_long_name"].unique())
away_team_id = sorted(data["away_team_long_name"].unique())
def predict(*args):
# TODO: need to complete the function
# if str(home_team_id.value) == None:
# print(str(home_team_id.value))
# raise gr.Error("Home Team is required")
# if str(Away_team_id.value) == None:
# raise gr.Error("Away Team is required")
# print(str(home_team_id.value))
# return str(home_team_id.value)
return "None"
# markup table for markdown
# # Members:
# | Students Name | Student ID |
# | :--- | :----: |
# | Zeel Karshanbhai Sheladiya | 500209119 |
# | Ravikumar Chandrakantbhai Patel | 500196861 |
# | Dharma Teja Reddy Bandreddi | 500209454 |
# | Sai Charan Reddy Meda | 500201602 |
# | Aditya Babu | 500209122 |
# | Sudip Bhattarai | 500198055 |
# | NOMAN FAZAL MUKADAM | 500209115 |
# | Leela Prasad Kavuri | 500209550 |
# | Vamsi Dasari | 500200775 |
with gr.Blocks() as demo:
gr.Markdown("""
# Subject: Data Science Project Management and Requirement Gathering 02 (Group 4)
[![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/ravi7522/Football-Prediction)
""")
with gr.Row():
gr.Label("⚽️ Football Prediction ⚽️", container=False)
with gr.Row():
with gr.Column():
home_team_id = gr.Dropdown(
label="Home Team",
choices=home_team_id,
max_choices=1,
)
with gr.Column():
Away_team_id = gr.Dropdown(
label="Away Team",
choices=away_team_id,
max_choices=1,
)
with gr.Row():
predict_btn = gr.Button(value="Predict")
with gr.Row():
Answer = gr.Label("👋 Hello, Let us predict the Football Match 💁‍♂️", container=False)
predict_btn.click(
predict,
inputs=[
home_team_id,
Away_team_id,
],
outputs=[Answer],
)
demo.launch()