fdisk commited on
Commit
db92967
·
1 Parent(s): 19112df

API arg 추가 add repo_type

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -10,14 +10,8 @@ from src.about import (
10
  )
11
  from src.display.css_html_js import custom_css
12
  from huggingface_hub import HfApi
13
- repo_id = "qinference/AIM100Leaderboard"
14
  api = HfApi()
15
- last_updated = datetime.now().strftime('Last updated at %Y-%m-%d %H:%m:%S')
16
-
17
-
18
- def restart_leaderboard():
19
- api.pause_space(repo_id=repo_id)
20
- api.restart_space(repo_id=repo_id)
21
 
22
 
23
  def get_evaluation():
@@ -71,6 +65,15 @@ original_df = get_evaluation()
71
  leaderboard_df = original_df.copy()
72
 
73
 
 
 
 
 
 
 
 
 
 
74
  leaderboard = gr.Blocks(css=custom_css)
75
  with leaderboard:
76
  gr.HTML(TITLE)
@@ -80,7 +83,7 @@ with leaderboard:
80
  with gr.TabItem("🏅 LLM Benchmark", elem_id="llm-benchmark-tab-table", id=0):
81
  with gr.Row():
82
  search_bar = gr.Textbox(
83
- placeholder=" 🔍 Search for your model (separate multiple queries with `;`) and press ENTER...",
84
  show_label=False,
85
  elem_id="search-bar",
86
  )
 
10
  )
11
  from src.display.css_html_js import custom_css
12
  from huggingface_hub import HfApi
 
13
  api = HfApi()
14
+ last_updated = datetime.now().strftime('Last updated at %Y-%m-%d %H:%m:%S')
 
 
 
 
 
15
 
16
 
17
  def get_evaluation():
 
65
  leaderboard_df = original_df.copy()
66
 
67
 
68
+ def restart_leaderboard():
69
+ global original_df, leaderboard_df
70
+ original_df = get_evaluation()
71
+ leaderboard_df = original_df.copy()
72
+ repo_id = "qinference/AIM100Leaderboard"
73
+ api.pause_space(repo_id=repo_id, repo_type="space")
74
+ api.restart_space(repo_id=repo_id, repo_type="space")
75
+
76
+
77
  leaderboard = gr.Blocks(css=custom_css)
78
  with leaderboard:
79
  gr.HTML(TITLE)
 
83
  with gr.TabItem("🏅 LLM Benchmark", elem_id="llm-benchmark-tab-table", id=0):
84
  with gr.Row():
85
  search_bar = gr.Textbox(
86
+ placeholder=" 🔍 Search for your model type and press ENTER...",
87
  show_label=False,
88
  elem_id="search-bar",
89
  )