Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -21,9 +21,6 @@ def clear_chat(state):
|
|
21 |
from datasets import load_dataset
|
22 |
import requests
|
23 |
|
24 |
-
HUGGINGFACE_DATASET_URL = "https://huggingface.co/datasets/your_username/your_dataset_name"
|
25 |
-
API_TOKEN = "your_huggingface_api_token" # Keep this secure
|
26 |
-
|
27 |
def get_user_elo_ratings():
|
28 |
dataset = load_dataset("rwitz/mistral-elo-ratings", streaming=True)
|
29 |
elo_ratings = dataset['train'] # or the relevant split
|
@@ -50,7 +47,7 @@ def update_elo_rating(player_id, new_rating):
|
|
50 |
updated_data = elo_ratings.to_dict()
|
51 |
response = requests.post(
|
52 |
"https://huggingface.co/datasets/rwitz/mistral-elo-ratings",
|
53 |
-
headers={"Authorization": f"Bearer {os.environ.get(
|
54 |
json=updated_data
|
55 |
)
|
56 |
if response.status_code == 200:
|
|
|
21 |
from datasets import load_dataset
|
22 |
import requests
|
23 |
|
|
|
|
|
|
|
24 |
def get_user_elo_ratings():
|
25 |
dataset = load_dataset("rwitz/mistral-elo-ratings", streaming=True)
|
26 |
elo_ratings = dataset['train'] # or the relevant split
|
|
|
47 |
updated_data = elo_ratings.to_dict()
|
48 |
response = requests.post(
|
49 |
"https://huggingface.co/datasets/rwitz/mistral-elo-ratings",
|
50 |
+
headers={"Authorization": f"Bearer {os.environ.get('huggingface_token')}"},
|
51 |
json=updated_data
|
52 |
)
|
53 |
if response.status_code == 200:
|