T145 commited on
Commit
3d20d45
·
1 Parent(s): f7982bc

App update

Browse files
Files changed (1) hide show
  1. app.py +13 -18
app.py CHANGED
@@ -1,17 +1,15 @@
1
  import os
2
- import time
3
- os.system("wget https://raw.githubusercontent.com/Weyaxi/scrape-open-llm-leaderboard/main/openllm.py")
4
- from huggingface_hub import HfApi, HfFileSystem
5
- import time
6
- import pandas as pd
7
  import threading
 
 
8
  import gradio as gr
9
  from gradio_space_ci import enable_space_ci
 
 
10
  from functions import commit
11
 
12
  enable_space_ci()
13
 
14
- HF_TOKEN = os.getenv('HF_TOKEN')
15
  BOT_HF_TOKEN = os.getenv('BOT_HF_TOKEN')
16
 
17
 
@@ -21,35 +19,32 @@ fs = HfFileSystem()
21
  def refresh(how_much=43200): # default to 12 hour
22
  time.sleep(how_much)
23
  try:
24
- api.restart_space(repo_id="Weyaxi/leaderboard-results-to-modelcard")
25
  except Exception as e:
26
  print(f"Error while scraping leaderboard, trying again... {e}")
27
  refresh(600) # 10 minutes if any error happens
28
 
29
- gradio_title="🧐 Open LLM Leaderboard Results PR Opener"
30
- gradio_desc= """🎯 This tool's aim is to provide [Open LLM Leaderboard](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) results in the model card.
31
-
32
- ## 💭 What Does This Tool Do:
33
 
34
  - 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.
35
 
36
- - This tool also adds evaluation results as your model's metadata to showcase the evaluation results as a widget.
37
 
38
  ## 🛠️ Backend
39
 
40
- The leaderboard's backend mainly runs on the [Hugging Face Hub API](https://huggingface.co/docs/huggingface_hub/v0.5.1/en/package_reference/hf_api).
41
 
42
  ## 🤝 Acknowledgements
43
 
44
- - Special thanks to [Clémentine Fourrier (clefourrier)](https://huggingface.co/clefourrier) for her help and contributions to the code.
45
-
46
- - Special thanks to [Lucain Pouget (Wauplin)](https://huggingface.co/Wauplin) for assisting with the [Hugging Face Hub API](https://huggingface.co/docs/huggingface_hub/v0.5.1/en/package_reference/hf_api).
47
  """
48
 
49
  with gr.Blocks() as demo:
50
  gr.HTML(f"""<h1 align="center" id="space-title">{gradio_title}</h1>""")
51
- gr.HTML(f"""<h1 align="center" id="space-title" style="font-weight: bold; font-size: 40px; color: red;">DON'T SPAM MODELS!</h1>""")
52
- gr.HTML(f"""<h1 align="center" id="space-title" style="font-weight: bold; font-size: 25px; color: red;">I understand why you are angry, but spamming won't change anything!</h1>""")
53
 
54
  gr.Markdown(gradio_desc)
55
 
 
1
  import os
 
 
 
 
 
2
  import threading
3
+ import time
4
+
5
  import gradio as gr
6
  from gradio_space_ci import enable_space_ci
7
+ from huggingface_hub import HfApi, HfFileSystem
8
+
9
  from functions import commit
10
 
11
  enable_space_ci()
12
 
 
13
  BOT_HF_TOKEN = os.getenv('BOT_HF_TOKEN')
14
 
15
 
 
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
+ gradio_title="Modelcards + Open LLM Leaderboard Results"
28
+ gradio_desc= """
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.
32
 
33
+ - This tool also adds evaluation results to your model metadata and showcases the evaluation results as a widget.
34
 
35
  ## 🛠️ Backend
36
 
37
+ The leaderboard's backend mainly runs on the [Hugging Face Hub API](https://huggingface.co/docs/huggingface_hub/v0.26.3/package_reference/hf_api).
38
 
39
  ## 🤝 Acknowledgements
40
 
41
+ - Special thanks to [Yağız Çalık (Weyaxi)](https://huggingface.co/Weyaxi) for the original tool.
 
 
42
  """
43
 
44
  with gr.Blocks() as demo:
45
  gr.HTML(f"""<h1 align="center" id="space-title">{gradio_title}</h1>""")
46
+ gr.HTML("""<h1 align="center" id="space-title" style="font-weight: bold; font-size: 40px; color: red;">DON'T SPAM MODELS!</h1>""")
47
+ gr.HTML("""<h1 align="center" id="space-title" style="font-weight: bold; font-size: 25px; color: red;">It won't change anything!</h1>""")
48
 
49
  gr.Markdown(gradio_desc)
50