Weyaxi commited on
Commit
d2fc390
1 Parent(s): 8986594

minor error fix

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -173,11 +173,12 @@ def clickable(x, which_one):
173
  return f'<a target="_blank" href="https://huggingface.co/{which_one}/{x}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{x}</a>'
174
 
175
 
176
- def models_df_to_clickable(df, columns, which_one):
177
  for column in columns:
178
  if column == "Organization Name":
179
  df[column] = df[column].apply(lambda x: clickable(x, "models"))
180
- df[column] = df[column].apply(lambda x: clickable(x, which_one))
 
181
  return df
182
 
183
 
@@ -189,7 +190,7 @@ with gr.Blocks() as demo:
189
  columns_to_convert = ["Organization Name", "Best Model On Open LLM Leaderboard", "Most Downloaded Model", "Most Liked Model"]
190
 
191
  models_df = make_leaderboard(org_names_in_list, "models")
192
- models_df = models_df_to_clickable(models_df, columns_to_convert, "models")
193
 
194
  headers = ["🔢 Serial Number", "🏢 Organization Name", "📥 Total Downloads", "👍 Total Likes", "🤖 Number of Models",
195
  "🏆 Best Model On Open LLM Leaderboard", "🥇 Best Rank On Open LLM Leaderboard",
@@ -203,7 +204,7 @@ with gr.Blocks() as demo:
203
  with gr.TabItem("📊 Dataset", id=2):
204
  columns_to_convert = ["Organization Name", "Most Downloaded Dataset", "Most Liked Dataset"]
205
  dataset_df = make_leaderboard(org_names_in_list, "datasets")
206
- dataset_df = models_df_to_clickable(dataset_df, columns_to_convert, "datasets")
207
 
208
  headers = ["🔢 Serial Number", "🏢 Organization Name", "📥 Total Downloads", "👍 Total Likes",
209
  "📊 Number of Datasets", "📊 Average Downloads per Dataset", "📈 Average Likes per Dataset",
@@ -217,7 +218,7 @@ with gr.Blocks() as demo:
217
  columns_to_convert = ["Organization Name", "Most Liked Space"]
218
 
219
  spaces_df = make_leaderboard(org_names_in_list, "spaces")
220
- spaces_df = models_df_to_clickable(spaces_df, columns_to_convert, "spaces")
221
 
222
  headers = ["🔢 Serial Number", "🏢 Organization Name", "👍 Total Likes", "🚀 Number of Spaces",
223
  "📈 Average Likes per Space", "❤ Most Liked Space", "👍 Most Like Count"]
 
173
  return f'<a target="_blank" href="https://huggingface.co/{which_one}/{x}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{x}</a>'
174
 
175
 
176
+ def df_to_clickable(df, columns, which_one):
177
  for column in columns:
178
  if column == "Organization Name":
179
  df[column] = df[column].apply(lambda x: clickable(x, "models"))
180
+ else:
181
+ df[column] = df[column].apply(lambda x: clickable(x, which_one))
182
  return df
183
 
184
 
 
190
  columns_to_convert = ["Organization Name", "Best Model On Open LLM Leaderboard", "Most Downloaded Model", "Most Liked Model"]
191
 
192
  models_df = make_leaderboard(org_names_in_list, "models")
193
+ models_df = df_to_clickable(models_df, columns_to_convert, "models")
194
 
195
  headers = ["🔢 Serial Number", "🏢 Organization Name", "📥 Total Downloads", "👍 Total Likes", "🤖 Number of Models",
196
  "🏆 Best Model On Open LLM Leaderboard", "🥇 Best Rank On Open LLM Leaderboard",
 
204
  with gr.TabItem("📊 Dataset", id=2):
205
  columns_to_convert = ["Organization Name", "Most Downloaded Dataset", "Most Liked Dataset"]
206
  dataset_df = make_leaderboard(org_names_in_list, "datasets")
207
+ dataset_df = df_to_clickable(dataset_df, columns_to_convert, "datasets")
208
 
209
  headers = ["🔢 Serial Number", "🏢 Organization Name", "📥 Total Downloads", "👍 Total Likes",
210
  "📊 Number of Datasets", "📊 Average Downloads per Dataset", "📈 Average Likes per Dataset",
 
218
  columns_to_convert = ["Organization Name", "Most Liked Space"]
219
 
220
  spaces_df = make_leaderboard(org_names_in_list, "spaces")
221
+ spaces_df = df_to_clickable(spaces_df, columns_to_convert, "spaces")
222
 
223
  headers = ["🔢 Serial Number", "🏢 Organization Name", "👍 Total Likes", "🚀 Number of Spaces",
224
  "📈 Average Likes per Space", "❤ Most Liked Space", "👍 Most Like Count"]