Spaces:
Runtime error
Runtime error
joffrey Thomas
commited on
Leaderboard
Browse files
yall.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
import os
|
| 2 |
-
import gistyc
|
| 3 |
import requests
|
| 4 |
from dataclasses import dataclass
|
| 5 |
import re
|
|
@@ -19,7 +18,6 @@ class GistInfo:
|
|
| 19 |
bigbench: float
|
| 20 |
average: float
|
| 21 |
|
| 22 |
-
|
| 23 |
def update_gist(content, gist_id, access_token):
|
| 24 |
"""
|
| 25 |
Update the content of a GitHub Gist.
|
|
@@ -50,67 +48,51 @@ def update_gist(content, gist_id, access_token):
|
|
| 50 |
print("Failed to update gist. Status code:", response.status_code)
|
| 51 |
print("Response:", response.json())
|
| 52 |
|
| 53 |
-
|
| 54 |
-
@st.cache_data
|
| 55 |
def create_yall():
|
| 56 |
-
#
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
gist_info = GistInfo(
|
| 100 |
-
gist_id=data_dict['id'],
|
| 101 |
-
filename=filename,
|
| 102 |
-
url=data_dict['html_url'], # Assuming html_url is the URL of the gist
|
| 103 |
-
model_name=model_name,
|
| 104 |
-
model_id=model_id,
|
| 105 |
-
model=values[0].strip(),
|
| 106 |
-
agieval=float(values[1].strip()),
|
| 107 |
-
gpt4all=float(values[2].strip()),
|
| 108 |
-
truthfulqa=float(values[3].strip()),
|
| 109 |
-
bigbench=float(values[4].strip()),
|
| 110 |
-
average=float(values[5].strip()),
|
| 111 |
-
)
|
| 112 |
-
gist_infos.append(gist_info)
|
| 113 |
-
|
| 114 |
# Sort the list by average
|
| 115 |
gist_infos = sorted(gist_infos, key=lambda x: x.average, reverse=True)
|
| 116 |
|
|
@@ -122,7 +104,7 @@ def create_yall():
|
|
| 122 |
model_link = f"[{gist.model_id}](https://huggingface.co/{gist.model_id})"
|
| 123 |
markdown_table += f"| {model_link} [📄]({gist.url}) | {gist.average} | {gist.agieval} | {gist.gpt4all} | {gist.truthfulqa} | {gist.bigbench} |\n"
|
| 124 |
|
| 125 |
-
# Update YALL's gist
|
| 126 |
-
update_gist(content=markdown_table, gist_id="
|
| 127 |
|
| 128 |
-
return markdown_table
|
|
|
|
| 1 |
import os
|
|
|
|
| 2 |
import requests
|
| 3 |
from dataclasses import dataclass
|
| 4 |
import re
|
|
|
|
| 18 |
bigbench: float
|
| 19 |
average: float
|
| 20 |
|
|
|
|
| 21 |
def update_gist(content, gist_id, access_token):
|
| 22 |
"""
|
| 23 |
Update the content of a GitHub Gist.
|
|
|
|
| 48 |
print("Failed to update gist. Status code:", response.status_code)
|
| 49 |
print("Response:", response.json())
|
| 50 |
|
| 51 |
+
@st.cache_data
|
|
|
|
| 52 |
def create_yall():
|
| 53 |
+
# Dummy data
|
| 54 |
+
gist_infos = [
|
| 55 |
+
GistInfo(
|
| 56 |
+
gist_id="dummy_gist_id_1",
|
| 57 |
+
filename="Model-1.md",
|
| 58 |
+
url="https://gist.github.com/dummy_gist_id_1",
|
| 59 |
+
model_name="Model 1",
|
| 60 |
+
model_id="model-1",
|
| 61 |
+
model="Model 1",
|
| 62 |
+
agieval=95.4,
|
| 63 |
+
gpt4all=88.7,
|
| 64 |
+
truthfulqa=90.3,
|
| 65 |
+
bigbench=85.6,
|
| 66 |
+
average=90.0
|
| 67 |
+
),
|
| 68 |
+
GistInfo(
|
| 69 |
+
gist_id="dummy_gist_id_2",
|
| 70 |
+
filename="Model-2.md",
|
| 71 |
+
url="https://gist.github.com/dummy_gist_id_2",
|
| 72 |
+
model_name="Model 2",
|
| 73 |
+
model_id="model-2",
|
| 74 |
+
model="Model 2",
|
| 75 |
+
agieval=89.1,
|
| 76 |
+
gpt4all=85.0,
|
| 77 |
+
truthfulqa=87.5,
|
| 78 |
+
bigbench=83.0,
|
| 79 |
+
average=86.2
|
| 80 |
+
),
|
| 81 |
+
GistInfo(
|
| 82 |
+
gist_id="dummy_gist_id_3",
|
| 83 |
+
filename="Model-3.md",
|
| 84 |
+
url="https://gist.github.com/dummy_gist_id_3",
|
| 85 |
+
model_name="Model 3",
|
| 86 |
+
model_id="model-3",
|
| 87 |
+
model="Model 3",
|
| 88 |
+
agieval=78.2,
|
| 89 |
+
gpt4all=81.4,
|
| 90 |
+
truthfulqa=79.5,
|
| 91 |
+
bigbench=77.0,
|
| 92 |
+
average=79.0
|
| 93 |
+
)
|
| 94 |
+
]
|
| 95 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
# Sort the list by average
|
| 97 |
gist_infos = sorted(gist_infos, key=lambda x: x.average, reverse=True)
|
| 98 |
|
|
|
|
| 104 |
model_link = f"[{gist.model_id}](https://huggingface.co/{gist.model_id})"
|
| 105 |
markdown_table += f"| {model_link} [📄]({gist.url}) | {gist.average} | {gist.agieval} | {gist.gpt4all} | {gist.truthfulqa} | {gist.bigbench} |\n"
|
| 106 |
|
| 107 |
+
# Update YALL's gist with dummy gist ID and token
|
| 108 |
+
update_gist(content=markdown_table, gist_id="dummy_gist_id_yall", access_token="dummy_access_token")
|
| 109 |
|
| 110 |
+
return markdown_table
|