Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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':
|
448 |
-
'sort': '
|
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':
|
482 |
-
'sort': '
|
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':
|
516 |
-
'sort': '
|
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
|
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
|
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
|
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()
|