Spaces:
Sleeping
Sleeping
Commit
·
4675209
1
Parent(s):
12a2408
Add bid points
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ from pathlib import Path
|
|
| 8 |
import pandas as pd
|
| 9 |
import pytz
|
| 10 |
import streamlit as st
|
| 11 |
-
from datasets import Dataset, load_dataset
|
| 12 |
from huggingface_hub import CommitScheduler
|
| 13 |
|
| 14 |
# File paths as constants
|
|
@@ -199,9 +199,9 @@ def submit_prediction(
|
|
| 199 |
|
| 200 |
|
| 201 |
def get_user_total_points(user_name):
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
users = load_users(USERS_JSON)
|
| 205 |
return users.get(user_name, {}).get('points')
|
| 206 |
|
| 207 |
|
|
@@ -415,6 +415,12 @@ def fetch_latest_predictions(match_id):
|
|
| 415 |
|
| 416 |
|
| 417 |
def update_leaderboard_and_outcomes(match_id, winning_team, man_of_the_match, outcome_only=False):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 418 |
# Load existing match outcomes
|
| 419 |
outcomes = load_dataset("Jay-Rajput/DIS_IPL_Outcomes", split="train")
|
| 420 |
outcomes_df = pd.DataFrame(outcomes)
|
|
|
|
| 8 |
import pandas as pd
|
| 9 |
import pytz
|
| 10 |
import streamlit as st
|
| 11 |
+
from datasets import Dataset, load_dataset, Features, Value
|
| 12 |
from huggingface_hub import CommitScheduler
|
| 13 |
|
| 14 |
# File paths as constants
|
|
|
|
| 199 |
|
| 200 |
|
| 201 |
def get_user_total_points(user_name):
|
| 202 |
+
users_dataset = load_dataset("Jay-Rajput/DIS_IPL_Leads", split="train")
|
| 203 |
+
users = users_dataset.to_dict()
|
| 204 |
+
# users = load_users(USERS_JSON)
|
| 205 |
return users.get(user_name, {}).get('points')
|
| 206 |
|
| 207 |
|
|
|
|
| 415 |
|
| 416 |
|
| 417 |
def update_leaderboard_and_outcomes(match_id, winning_team, man_of_the_match, outcome_only=False):
|
| 418 |
+
features = Features({
|
| 419 |
+
'match_id': Value('string'),
|
| 420 |
+
'man_of_the_match': Value('string'),
|
| 421 |
+
'winning_team': Value('string'),
|
| 422 |
+
})
|
| 423 |
+
|
| 424 |
# Load existing match outcomes
|
| 425 |
outcomes = load_dataset("Jay-Rajput/DIS_IPL_Outcomes", split="train")
|
| 426 |
outcomes_df = pd.DataFrame(outcomes)
|