Weyaxi commited on
Commit
eb2ea0d
ยท
1 Parent(s): 364e449

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -16
app.py CHANGED
@@ -212,21 +212,12 @@ def get_ranking_trend(json_data, org_name):
212
  return {"id": "Not Found", "rank": "Not Found"}
213
 
214
 
215
- def fetch_data_from_url(url):
216
- response = requests.get(url)
217
- if response.status_code == 200:
218
- data = response.text.splitlines()
219
- return [line.strip() for line in data]
220
- else:
221
- print(f"Failed to fetch data from URL: {url}")
222
- return []
223
-
224
 
225
- user_names_url = "https://huggingface.co/datasets/PulsarAI/user-orgs-huggingface-leaderboard/raw/main/user_names.txt"
226
- org_names_url = "https://huggingface.co/datasets/PulsarAI/user-orgs-huggingface-leaderboard/raw/main/org_names.txt"
227
 
228
- org_names_in_list = fetch_data_from_url(user_names_url)
229
- user_names_in_list = fetch_data_from_url(org_names_url)
230
 
231
  datetime_now = str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M"))
232
  INTRODUCTION_TEXT = f"""
@@ -244,9 +235,9 @@ INTRODUCTION_TEXT = f"""
244
 
245
  ๐Ÿ› ๏ธ 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).
246
 
247
- **๐Ÿ“ Note:** In the model's dataframe, there are some columns related to the [Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard). This data is also retrieved through web scraping.
248
 
249
- **๐Ÿ“ Note:** In trending models/datasets/spaces, first 300 models/datasets/spaces is being retrieved from huggingface.
250
 
251
  ## ๐Ÿ” Searching Organizations and Users
252
 
@@ -547,4 +538,4 @@ filtered_datasets_orgs = update_table_datasets(orgs=True, users=False, return_al
547
  filtered_spaces_users = update_table_spaces(orgs=False, users=True, return_all=True)['Author Name'].tolist()
548
  filtered_spaces_orgs = update_table_spaces(orgs=True, users=False, return_all=True)['Author Name'].tolist()
549
 
550
- demo.launch(debug=True)
 
212
  return {"id": "Not Found", "rank": "Not Found"}
213
 
214
 
 
 
 
 
 
 
 
 
 
215
 
216
+ with open("org_names.txt", "r") as f:
217
+ org_names_in_list = [i.rstrip("\n") for i in f.readlines()]
218
 
219
+ with open("user_names.txt", "r") as f:
220
+ user_names_in_list = [i.rstrip("\n") for i in f.readlines()]
221
 
222
  datetime_now = str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M"))
223
  INTRODUCTION_TEXT = f"""
 
235
 
236
  ๐Ÿ› ๏ธ 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).
237
 
238
+ **๐ŸŒ Note:** In the model's dataframe, there are some columns related to the [Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard). This data is also retrieved through web scraping.
239
 
240
+ **๐ŸŒ Note:** In trending models/datasets/spaces, first 300 models/datasets/spaces is being retrieved from huggingface.
241
 
242
  ## ๐Ÿ” Searching Organizations and Users
243
 
 
538
  filtered_spaces_users = update_table_spaces(orgs=False, users=True, return_all=True)['Author Name'].tolist()
539
  filtered_spaces_orgs = update_table_spaces(orgs=True, users=False, return_all=True)['Author Name'].tolist()
540
 
541
+ demo.launch(debug=True)