Fixed Ruff runtime
Browse files- app.py +17 -15
- pixi.toml +0 -25
- pyproject.toml +24 -0
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
import os
|
2 |
import threading
|
3 |
import time
|
4 |
|
@@ -10,22 +9,21 @@ from functions import commit
|
|
10 |
|
11 |
enable_space_ci()
|
12 |
|
13 |
-
BOT_HF_TOKEN = os.getenv('BOT_HF_TOKEN')
|
14 |
-
|
15 |
-
|
16 |
api = HfApi()
|
17 |
fs = HfFileSystem()
|
18 |
|
19 |
-
def refresh(how_much=43200): # default to 12 hour
|
20 |
-
time.sleep(how_much)
|
21 |
-
try:
|
22 |
-
api.restart_space(repo_id="T145/open-llm-leaderboard-results-to-modelcard")
|
23 |
-
except Exception as e:
|
24 |
-
print(f"Error while scraping leaderboard, trying again... {e}")
|
25 |
-
refresh(600) # 10 minutes if any error happens
|
26 |
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
## π― What This Tool Does
|
30 |
|
31 |
- This tool adds the [Open LLM Leaderboard](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) result of your model at the end of your model card.
|
@@ -43,8 +41,12 @@ The leaderboard's backend mainly runs on the [Hugging Face Hub API](https://hugg
|
|
43 |
|
44 |
with gr.Blocks() as demo:
|
45 |
gr.HTML(f"""<h1 align="center" id="space-title">{gradio_title}</h1>""")
|
46 |
-
gr.HTML(
|
47 |
-
|
|
|
|
|
|
|
|
|
48 |
|
49 |
gr.Markdown(gradio_desc)
|
50 |
|
|
|
|
|
1 |
import threading
|
2 |
import time
|
3 |
|
|
|
9 |
|
10 |
enable_space_ci()
|
11 |
|
|
|
|
|
|
|
12 |
api = HfApi()
|
13 |
fs = HfFileSystem()
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
+
def refresh(how_much=43200): # default to 12 hour
|
17 |
+
time.sleep(how_much)
|
18 |
+
try:
|
19 |
+
api.restart_space(repo_id="T145/open-llm-leaderboard-results-to-modelcard")
|
20 |
+
except Exception as e:
|
21 |
+
print(f"Error while scraping leaderboard, trying again... {e}")
|
22 |
+
refresh(600) # 10 minutes if any error happens
|
23 |
+
|
24 |
+
|
25 |
+
gradio_title = "Modelcards + Open LLM Leaderboard Results"
|
26 |
+
gradio_desc = """
|
27 |
## π― What This Tool Does
|
28 |
|
29 |
- This tool adds the [Open LLM Leaderboard](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) result of your model at the end of your model card.
|
|
|
41 |
|
42 |
with gr.Blocks() as demo:
|
43 |
gr.HTML(f"""<h1 align="center" id="space-title">{gradio_title}</h1>""")
|
44 |
+
gr.HTML(
|
45 |
+
"""<h1 align="center" id="space-title" style="font-weight: bold; font-size: 40px; color: red;">DON'T SPAM MODELS!</h1>"""
|
46 |
+
)
|
47 |
+
gr.HTML(
|
48 |
+
"""<h1 align="center" id="space-title" style="font-weight: bold; font-size: 25px; color: red;">It won't change anything!</h1>"""
|
49 |
+
)
|
50 |
|
51 |
gr.Markdown(gradio_desc)
|
52 |
|
pixi.toml
CHANGED
@@ -18,28 +18,3 @@ pytablewriter = ">=1.2.0, <2"
|
|
18 |
gradio-space-ci = { git = "https://huggingface.co/spaces/Wauplin/gradio-space-ci", rev = "0.2.3" }
|
19 |
beautifulsoup4 = ">=4.12.3, <5"
|
20 |
datasets = ">=3.1.0, <4"
|
21 |
-
|
22 |
-
[tool.ruff]
|
23 |
-
exclude = [".pixi", "__pycache__"]
|
24 |
-
ignore = ["E501", "E402"]
|
25 |
-
select = [
|
26 |
-
# pycodestyle
|
27 |
-
"E",
|
28 |
-
# Pyflakes
|
29 |
-
"F",
|
30 |
-
# Warnings
|
31 |
-
"W",
|
32 |
-
# isort
|
33 |
-
"I",
|
34 |
-
# pyupgrade
|
35 |
-
"UP",
|
36 |
-
# flake8-bugbear
|
37 |
-
"B",
|
38 |
-
# flake8-simplify
|
39 |
-
"SIM",
|
40 |
-
# flake8-quotes
|
41 |
-
"Q",
|
42 |
-
# flake8-async
|
43 |
-
"ASYNC"
|
44 |
-
]
|
45 |
-
line-length = 132
|
|
|
18 |
gradio-space-ci = { git = "https://huggingface.co/spaces/Wauplin/gradio-space-ci", rev = "0.2.3" }
|
19 |
beautifulsoup4 = ">=4.12.3, <5"
|
20 |
datasets = ">=3.1.0, <4"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pyproject.toml
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[tool.ruff]
|
2 |
+
exclude = [".pixi", "__pycache__"]
|
3 |
+
ignore = ["E501", "E402"]
|
4 |
+
select = [
|
5 |
+
# pycodestyle
|
6 |
+
"E",
|
7 |
+
# Pyflakes
|
8 |
+
"F",
|
9 |
+
# Warnings
|
10 |
+
"W",
|
11 |
+
# isort
|
12 |
+
"I",
|
13 |
+
# pyupgrade
|
14 |
+
"UP",
|
15 |
+
# flake8-bugbear
|
16 |
+
"B",
|
17 |
+
# flake8-simplify
|
18 |
+
"SIM",
|
19 |
+
# flake8-quotes
|
20 |
+
"Q",
|
21 |
+
# flake8-async
|
22 |
+
"ASYNC"
|
23 |
+
]
|
24 |
+
line-length = 132
|