openfree commited on
Commit
5a88e63
β€’
1 Parent(s): b714baa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -435,7 +435,6 @@ def get_card(item: dict, index: int, card_type: str = "space") -> str:
435
  </div>
436
  </div>
437
  """
438
-
439
  def get_trending_spaces(progress=gr.Progress()) -> Tuple[str, str]:
440
  """νŠΈλ Œλ”© 슀페이슀 κ°€μ Έμ˜€κΈ°"""
441
  url = "https://huggingface.co/api/spaces"
@@ -444,9 +443,10 @@ def get_trending_spaces(progress=gr.Progress()) -> Tuple[str, str]:
444
  progress(0, desc="Fetching spaces data...")
445
  params = {
446
  'full': 'true',
447
- 'limit': 10, # μƒμœ„ 10개만 κ°€μ Έμ˜€λ„λ‘ μˆ˜μ •
448
- 'sort': 'likes' # μ’‹μ•„μš” 순으둜 μ •λ ¬
449
  }
 
450
  response = requests.get(url, params=params)
451
  response.raise_for_status()
452
  spaces = response.json()
@@ -478,8 +478,8 @@ def get_models(progress=gr.Progress()) -> Tuple[str, str]:
478
  progress(0, desc="Fetching models data...")
479
  params = {
480
  'full': 'true',
481
- 'limit': 10, # μƒμœ„ 10개만 κ°€μ Έμ˜€λ„λ‘ μˆ˜μ •
482
- 'sort': 'likes' # μ’‹μ•„μš” 순으둜 μ •λ ¬
483
  }
484
  response = requests.get(url, params=params)
485
  response.raise_for_status()
@@ -512,8 +512,8 @@ def get_datasets(progress=gr.Progress()) -> Tuple[str, str]:
512
  progress(0, desc="Fetching datasets data...")
513
  params = {
514
  'full': 'true',
515
- 'limit': 10, # μƒμœ„ 10개만 κ°€μ Έμ˜€λ„λ‘ μˆ˜μ •
516
- 'sort': 'likes' # μ’‹μ•„μš” 순으둜 μ •λ ¬
517
  }
518
  response = requests.get(url, params=params)
519
  response.raise_for_status()
@@ -541,12 +541,12 @@ def get_datasets(progress=gr.Progress()) -> Tuple[str, str]:
541
  def create_interface():
542
  """Gradio μΈν„°νŽ˜μ΄μŠ€ 생성"""
543
  with gr.Blocks(title="HuggingFace Trending Board") as interface:
544
- gr.Markdown("# πŸ€— HuggingFace Trending Board")
545
 
546
  with gr.Tabs() as tabs:
547
  # Spaces νƒ­
548
  with gr.Tab("🎯 Trending Spaces"):
549
- gr.Markdown("Shows top 10 trending spaces with AI ratings")
550
  with gr.Row():
551
  spaces_refresh_btn = gr.Button("Refresh Spaces", variant="primary")
552
  spaces_gallery = gr.HTML()
@@ -554,7 +554,7 @@ def create_interface():
554
 
555
  # Models νƒ­
556
  with gr.Tab("πŸ€– Trending Models"):
557
- gr.Markdown("Shows top 10 trending models with AI ratings")
558
  with gr.Row():
559
  models_refresh_btn = gr.Button("Refresh Models", variant="primary")
560
  models_gallery = gr.HTML()
@@ -562,7 +562,7 @@ def create_interface():
562
 
563
  # Datasets νƒ­
564
  with gr.Tab("πŸ“Š Trending Datasets"):
565
- gr.Markdown("Shows top 10 trending datasets with AI ratings")
566
  with gr.Row():
567
  datasets_refresh_btn = gr.Button("Refresh Datasets", variant="primary")
568
  datasets_gallery = gr.HTML()
 
435
  </div>
436
  </div>
437
  """
 
438
  def get_trending_spaces(progress=gr.Progress()) -> Tuple[str, str]:
439
  """νŠΈλ Œλ”© 슀페이슀 κ°€μ Έμ˜€κΈ°"""
440
  url = "https://huggingface.co/api/spaces"
 
443
  progress(0, desc="Fetching spaces data...")
444
  params = {
445
  'full': 'true',
446
+ 'limit': 300,
447
+ 'sort': 'trending' # 'likes'μ—μ„œ 'trending'으둜 λ³€κ²½
448
  }
449
+
450
  response = requests.get(url, params=params)
451
  response.raise_for_status()
452
  spaces = response.json()
 
478
  progress(0, desc="Fetching models data...")
479
  params = {
480
  'full': 'true',
481
+ 'limit': 300,
482
+ 'sort': 'trending' # 'likes'μ—μ„œ 'trending'으둜 λ³€κ²½
483
  }
484
  response = requests.get(url, params=params)
485
  response.raise_for_status()
 
512
  progress(0, desc="Fetching datasets data...")
513
  params = {
514
  'full': 'true',
515
+ 'limit': 300,
516
+ 'sort': 'trending' # 'likes'μ—μ„œ 'trending'으둜 λ³€κ²½
517
  }
518
  response = requests.get(url, params=params)
519
  response.raise_for_status()
 
541
  def create_interface():
542
  """Gradio μΈν„°νŽ˜μ΄μŠ€ 생성"""
543
  with gr.Blocks(title="HuggingFace Trending Board") as interface:
544
+ gr.Markdown("# πŸ€— HuggingFace Trending TOP 300 Board")
545
 
546
  with gr.Tabs() as tabs:
547
  # Spaces νƒ­
548
  with gr.Tab("🎯 Trending Spaces"):
549
+ gr.Markdown("Shows top 300 trending spaces with AI ratings")
550
  with gr.Row():
551
  spaces_refresh_btn = gr.Button("Refresh Spaces", variant="primary")
552
  spaces_gallery = gr.HTML()
 
554
 
555
  # Models νƒ­
556
  with gr.Tab("πŸ€– Trending Models"):
557
+ gr.Markdown("Shows top 300 trending models with AI ratings")
558
  with gr.Row():
559
  models_refresh_btn = gr.Button("Refresh Models", variant="primary")
560
  models_gallery = gr.HTML()
 
562
 
563
  # Datasets νƒ­
564
  with gr.Tab("πŸ“Š Trending Datasets"):
565
+ gr.Markdown("Shows top 300 trending datasets with AI ratings")
566
  with gr.Row():
567
  datasets_refresh_btn = gr.Button("Refresh Datasets", variant="primary")
568
  datasets_gallery = gr.HTML()