openfree commited on
Commit
4573726
ยท
verified ยท
1 Parent(s): 0852d99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -303,7 +303,7 @@ def get_models_data(progress=gr.Progress()):
303
  progress(0, desc="Fetching models data...")
304
  params = {
305
  'full': 'true',
306
- 'limit': 3000,
307
  'sort': 'downloads',
308
  'direction': -1
309
  }
@@ -354,7 +354,7 @@ def get_models_data(progress=gr.Progress()):
354
  downloads = [model.get('downloads', 0) for model in filtered_models]
355
 
356
  # Y์ถ• ๊ฐ’์„ ๋ฐ˜์ „
357
- y_values = [10001 - r for r in ranks]
358
 
359
  # ๋ง‰๋Œ€ ๊ทธ๋ž˜ํ”„ ์ƒ์„ฑ
360
  fig.add_trace(go.Bar(
@@ -378,9 +378,9 @@ def get_models_data(progress=gr.Progress()):
378
  xaxis_title='Model ID',
379
  yaxis_title='Global Rank',
380
  yaxis=dict(
381
- ticktext=[str(i) for i in range(1, 3001, 50)],
382
- tickvals=[3001 - i for i in range(1, 3001, 50)],
383
- range=[0, 3000]
384
  ),
385
  height=800,
386
  showlegend=False,
@@ -533,7 +533,7 @@ def get_spaces_data(sort_type="trending", progress=gr.Progress()):
533
  url = f"https://huggingface.co/api/spaces"
534
  params = {
535
  'full': 'true',
536
- 'limit': 2400
537
  }
538
 
539
  if sort_type == "modes":
@@ -592,9 +592,9 @@ def get_spaces_data(sort_type="trending", progress=gr.Progress()):
592
  xaxis_title='Space ID',
593
  yaxis_title='Rank',
594
  yaxis=dict(
595
- ticktext=[str(i) for i in range(1, 2401, 20)], # 1๋ถ€ํ„ฐ 300๊นŒ์ง€ 20 ๊ฐ„๊ฒฉ
596
- tickvals=[2401 - i for i in range(1, 2401, 20)], # ๋ฐ˜์ „๋œ ๊ฐ’
597
- range=[0, 2400] # y์ถ• ๋ฒ”์œ„ ์„ค์ •
598
  ),
599
  height=800,
600
  showlegend=False,
@@ -615,8 +615,7 @@ def get_spaces_data(sort_type="trending", progress=gr.Progress()):
615
  space_id = space.get('id', '')
616
  rank = space.get('rank', 'N/A')
617
  likes = space.get('likes', 0)
618
- title = space.get('title', 'No Title') # TITLE ์ถ”๊ฐ€
619
-
620
  description = space.get('description', 'No Description')[:100]
621
 
622
  html_content += f"""
 
303
  progress(0, desc="Fetching models data...")
304
  params = {
305
  'full': 'true',
306
+ 'limit': 1000,
307
  'sort': 'downloads',
308
  'direction': -1
309
  }
 
354
  downloads = [model.get('downloads', 0) for model in filtered_models]
355
 
356
  # Y์ถ• ๊ฐ’์„ ๋ฐ˜์ „
357
+ y_values = [1001 - r for r in ranks]
358
 
359
  # ๋ง‰๋Œ€ ๊ทธ๋ž˜ํ”„ ์ƒ์„ฑ
360
  fig.add_trace(go.Bar(
 
378
  xaxis_title='Model ID',
379
  yaxis_title='Global Rank',
380
  yaxis=dict(
381
+ ticktext=[str(i) for i in range(1, 1001, 50)],
382
+ tickvals=[1001 - i for i in range(1, 1001, 50)],
383
+ range=[0, 1000]
384
  ),
385
  height=800,
386
  showlegend=False,
 
533
  url = f"https://huggingface.co/api/spaces"
534
  params = {
535
  'full': 'true',
536
+ 'limit': 300
537
  }
538
 
539
  if sort_type == "modes":
 
592
  xaxis_title='Space ID',
593
  yaxis_title='Rank',
594
  yaxis=dict(
595
+ ticktext=[str(i) for i in range(1, 301, 20)], # 1๋ถ€ํ„ฐ 300๊นŒ์ง€ 20 ๊ฐ„๊ฒฉ
596
+ tickvals=[301 - i for i in range(1, 301, 20)], # ๋ฐ˜์ „๋œ ๊ฐ’
597
+ range=[0, 300] # y์ถ• ๋ฒ”์œ„ ์„ค์ •
598
  ),
599
  height=800,
600
  showlegend=False,
 
615
  space_id = space.get('id', '')
616
  rank = space.get('rank', 'N/A')
617
  likes = space.get('likes', 0)
618
+ title = space.get('title', 'No Title')
 
619
  description = space.get('description', 'No Description')[:100]
620
 
621
  html_content += f"""