Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -661,12 +661,25 @@ def create_interface():
|
|
661 |
box-shadow: 0 0 0 2px rgba(123,97,255,0.2);
|
662 |
}
|
663 |
.sort-radio {
|
664 |
-
display:
|
665 |
-
|
|
|
666 |
background: #f5f5f5;
|
667 |
padding: 10px;
|
668 |
border-radius: 10px;
|
669 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
670 |
.refresh-btn {
|
671 |
background: linear-gradient(135deg, #7b61ff, #6366f1);
|
672 |
color: white;
|
@@ -675,6 +688,7 @@ def create_interface():
|
|
675 |
border-radius: 10px;
|
676 |
cursor: pointer;
|
677 |
transition: all 0.3s ease;
|
|
|
678 |
}
|
679 |
.refresh-btn:hover {
|
680 |
transform: translateY(-2px);
|
@@ -691,86 +705,87 @@ def create_interface():
|
|
691 |
with gr.Tabs() as tabs:
|
692 |
# Spaces ν
|
693 |
with gr.Tab("π― Trending Spaces"):
|
|
|
694 |
with gr.Row(elem_classes="search-sort-container"):
|
695 |
-
with gr.
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
)
|
716 |
spaces_gallery = gr.HTML()
|
717 |
-
spaces_status = gr.Markdown("
|
718 |
|
719 |
# Models ν
|
720 |
with gr.Tab("π€ Trending Models"):
|
|
|
721 |
with gr.Row(elem_classes="search-sort-container"):
|
722 |
-
with gr.
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
)
|
743 |
models_gallery = gr.HTML()
|
744 |
-
models_status = gr.Markdown("
|
745 |
|
746 |
# Datasets ν
|
747 |
with gr.Tab("π Trending Datasets"):
|
|
|
|
|
748 |
with gr.Row(elem_classes="search-sort-container"):
|
749 |
-
with gr.
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
)
|
770 |
datasets_gallery = gr.HTML()
|
771 |
-
datasets_status = gr.Markdown("
|
772 |
|
773 |
-
# Event handlers
|
774 |
spaces_refresh_btn.click(
|
775 |
fn=get_trending_spaces,
|
776 |
inputs=[spaces_search, spaces_sort],
|
@@ -827,6 +842,23 @@ def create_interface():
|
|
827 |
outputs=[datasets_gallery, datasets_status]
|
828 |
)
|
829 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
830 |
return interface
|
831 |
|
832 |
if __name__ == "__main__":
|
|
|
661 |
box-shadow: 0 0 0 2px rgba(123,97,255,0.2);
|
662 |
}
|
663 |
.sort-radio {
|
664 |
+
display: flex;
|
665 |
+
justify-content: space-between;
|
666 |
+
gap: 10px;
|
667 |
background: #f5f5f5;
|
668 |
padding: 10px;
|
669 |
border-radius: 10px;
|
670 |
}
|
671 |
+
.sort-radio label {
|
672 |
+
flex: 1;
|
673 |
+
text-align: center;
|
674 |
+
padding: 8px;
|
675 |
+
background: white;
|
676 |
+
border-radius: 8px;
|
677 |
+
cursor: pointer;
|
678 |
+
transition: all 0.3s ease;
|
679 |
+
}
|
680 |
+
.sort-radio label:hover {
|
681 |
+
background: #e0e0e0;
|
682 |
+
}
|
683 |
.refresh-btn {
|
684 |
background: linear-gradient(135deg, #7b61ff, #6366f1);
|
685 |
color: white;
|
|
|
688 |
border-radius: 10px;
|
689 |
cursor: pointer;
|
690 |
transition: all 0.3s ease;
|
691 |
+
width: 120px; /* λ²νΌ λλΉ μ‘°μ */
|
692 |
}
|
693 |
.refresh-btn:hover {
|
694 |
transform: translateY(-2px);
|
|
|
705 |
with gr.Tabs() as tabs:
|
706 |
# Spaces ν
|
707 |
with gr.Tab("π― Trending Spaces"):
|
708 |
+
gr.Markdown("Shows top 300 trending spaces with AI ratings")
|
709 |
with gr.Row(elem_classes="search-sort-container"):
|
710 |
+
with gr.Column(scale=2):
|
711 |
+
spaces_search = gr.Textbox(
|
712 |
+
label="π Search Spaces",
|
713 |
+
placeholder="Enter keywords to search...",
|
714 |
+
elem_classes="search-box"
|
715 |
+
)
|
716 |
+
with gr.Column(scale=2):
|
717 |
+
spaces_sort = gr.Radio(
|
718 |
+
choices=["rank", "rising_rate", "popularity"],
|
719 |
+
value="rank",
|
720 |
+
label="π Sort by",
|
721 |
+
interactive=True,
|
722 |
+
elem_classes="sort-radio"
|
723 |
+
)
|
724 |
+
with gr.Column(scale=1):
|
725 |
+
spaces_refresh_btn = gr.Button(
|
726 |
+
"π Refresh",
|
727 |
+
variant="primary",
|
728 |
+
elem_classes="refresh-btn"
|
729 |
+
)
|
|
|
730 |
spaces_gallery = gr.HTML()
|
731 |
+
spaces_status = gr.Markdown("Loading...")
|
732 |
|
733 |
# Models ν
|
734 |
with gr.Tab("π€ Trending Models"):
|
735 |
+
gr.Markdown("Shows top 300 trending models with AI ratings")
|
736 |
with gr.Row(elem_classes="search-sort-container"):
|
737 |
+
with gr.Column(scale=2):
|
738 |
+
models_search = gr.Textbox(
|
739 |
+
label="π Search Models",
|
740 |
+
placeholder="Enter keywords to search...",
|
741 |
+
elem_classes="search-box"
|
742 |
+
)
|
743 |
+
with gr.Column(scale=2):
|
744 |
+
models_sort = gr.Radio(
|
745 |
+
choices=["rank", "rising_rate", "popularity"],
|
746 |
+
value="rank",
|
747 |
+
label="π Sort by",
|
748 |
+
interactive=True,
|
749 |
+
elem_classes="sort-radio"
|
750 |
+
)
|
751 |
+
with gr.Column(scale=1):
|
752 |
+
models_refresh_btn = gr.Button(
|
753 |
+
"π Refresh",
|
754 |
+
variant="primary",
|
755 |
+
elem_classes="refresh-btn"
|
756 |
+
)
|
|
|
757 |
models_gallery = gr.HTML()
|
758 |
+
models_status = gr.Markdown("Loading...")
|
759 |
|
760 |
# Datasets ν
|
761 |
with gr.Tab("π Trending Datasets"):
|
762 |
+
gr.Markdown("Shows top 300 trending datasets with AI ratings")
|
763 |
+
|
764 |
with gr.Row(elem_classes="search-sort-container"):
|
765 |
+
with gr.Column(scale=2):
|
766 |
+
datasets_search = gr.Textbox(
|
767 |
+
label="π Search Datasets",
|
768 |
+
placeholder="Enter keywords to search...",
|
769 |
+
elem_classes="search-box"
|
770 |
+
)
|
771 |
+
with gr.Column(scale=2):
|
772 |
+
datasets_sort = gr.Radio(
|
773 |
+
choices=["rank", "rising_rate", "popularity"],
|
774 |
+
value="rank",
|
775 |
+
label="π Sort by",
|
776 |
+
interactive=True,
|
777 |
+
elem_classes="sort-radio"
|
778 |
+
)
|
779 |
+
with gr.Column(scale=1):
|
780 |
+
datasets_refresh_btn = gr.Button(
|
781 |
+
"π Refresh",
|
782 |
+
variant="primary",
|
783 |
+
elem_classes="refresh-btn"
|
784 |
+
)
|
|
|
785 |
datasets_gallery = gr.HTML()
|
786 |
+
datasets_status = gr.Markdown("Loading...")
|
787 |
|
788 |
+
# Event handlers
|
789 |
spaces_refresh_btn.click(
|
790 |
fn=get_trending_spaces,
|
791 |
inputs=[spaces_search, spaces_sort],
|
|
|
842 |
outputs=[datasets_gallery, datasets_status]
|
843 |
)
|
844 |
|
845 |
+
# μ΄κΈ° λ°μ΄ν° λ‘λ
|
846 |
+
interface.load(
|
847 |
+
fn=get_trending_spaces,
|
848 |
+
inputs=[spaces_search, spaces_sort],
|
849 |
+
outputs=[spaces_gallery, spaces_status]
|
850 |
+
)
|
851 |
+
interface.load(
|
852 |
+
fn=get_models,
|
853 |
+
inputs=[models_search, models_sort],
|
854 |
+
outputs=[models_gallery, models_status]
|
855 |
+
)
|
856 |
+
interface.load(
|
857 |
+
fn=get_datasets,
|
858 |
+
inputs=[datasets_search, datasets_sort],
|
859 |
+
outputs=[datasets_gallery, datasets_status]
|
860 |
+
)
|
861 |
+
|
862 |
return interface
|
863 |
|
864 |
if __name__ == "__main__":
|