philippds commited on
Commit
2103a11
1 Parent(s): 2820ed5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -6
app.py CHANGED
@@ -21,11 +21,17 @@ HF_TOKEN = os.environ.get("HF_TOKEN")
21
  block = gr.Blocks()
22
  api = HfApi(token=HF_TOKEN)
23
 
24
- # custom_css = """
25
  # .tab-buttons button {
26
  # font-size: 20px;
27
  # }
28
- # """
 
 
 
 
 
 
29
 
30
  hivex_envs = [
31
  {
@@ -64,7 +70,15 @@ def restart():
64
  def download_leaderboard_dataset():
65
  path = snapshot_download(repo_id=DATASET_REPO_ID, repo_type="dataset")
66
  return path
 
67
 
 
 
 
 
 
 
 
68
 
69
  def get_model_ids(hivex_env):
70
  api = HfApi()
@@ -160,12 +174,11 @@ def get_data(rl_env, task, path) -> pd.DataFrame:
160
 
161
  run_update_dataset()
162
 
163
- # block = gr.Blocks(css=custom_css)
164
- block = gr.Blocks()
165
  with block:
166
  with gr.Row(elem_id="header-row"):
167
- # TITLE + "<p>Total models: " + str(len(HARD_LEADERBOARD_DF))+ "</p>"
168
- gr.HTML("<h1>HIVEX-Leaderboard</h1>")
169
 
170
  path_ = download_leaderboard_dataset()
171
  # gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
 
21
  block = gr.Blocks()
22
  api = HfApi(token=HF_TOKEN)
23
 
24
+
25
  # .tab-buttons button {
26
  # font-size: 20px;
27
  # }
28
+
29
+ custom_css = """
30
+ /* Full width space */
31
+ .gradio-container {
32
+ max-width: 95%!important;
33
+ }
34
+ """
35
 
36
  hivex_envs = [
37
  {
 
70
  def download_leaderboard_dataset():
71
  path = snapshot_download(repo_id=DATASET_REPO_ID, repo_type="dataset")
72
  return path
73
+
74
 
75
+ def get_total_models():
76
+ total_models = 0
77
+ for hivex_env in hivex_envs:
78
+ model_ids = get_model_ids(hivex_env["hivex_env"])
79
+ total_models += len(model_ids)
80
+ return total_models
81
+
82
 
83
  def get_model_ids(hivex_env):
84
  api = HfApi()
 
174
 
175
  run_update_dataset()
176
 
177
+ block = gr.Blocks(css=custom_css)
 
178
  with block:
179
  with gr.Row(elem_id="header-row"):
180
+ total_models = get_total_models()
181
+ gr.HTML(f"<h1>HIVEX-Leaderboard</h1><p>Total models: {total_models}</p>")
182
 
183
  path_ = download_leaderboard_dataset()
184
  # gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")