File size: 4,013 Bytes
1597f7e
 
 
 
 
 
 
2ff0dd4
1597f7e
 
 
ee4c075
 
1597f7e
ee4c075
 
 
 
 
2ff0dd4
ee4c075
 
2ff0dd4
 
ee4c075
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1597f7e
ee4c075
 
2ff0dd4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ee4c075
 
 
 
 
 
 
 
 
 
 
0d08829
2ff0dd4
0d08829
c96c458
 
 
 
 
 
 
 
 
0d08829
1597f7e
0d08829
d85f4e7
0d08829
1597f7e
 
 
 
4c178d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import gradio as gr
import pandas as pd
import plotly.express as px
from datetime import datetime, timedelta
import requests
from io import BytesIO

[์ด์ „ ํ•จ์ˆ˜๋“ค์€ ๋™์ผํ•˜๊ฒŒ ์œ ์ง€...]

# Gradio ์ธํ„ฐํŽ˜์ด์Šค ์ƒ์„ฑ
with gr.Blocks(theme=gr.themes.Soft()) as demo:
    gr.Markdown("""
    # HF Space Ranking Tracker
    
    Track, analyze, and discover trending AI applications in the Hugging Face ecosystem. Our service continuously monitors and ranks all Spaces over a 30-day period, providing detailed analytics and daily ranking changes for the top 100 performers.
    """)
    
    with gr.Tabs():
        with gr.Tab("Dashboard"):
            with gr.Row(variant="panel"):
                trend_plot = gr.Plot(
                    label="Daily Rank Trend",
                    container=True,
                    height=400
                )
            
            with gr.Row():
                info_box = gr.HTML(
                    value="<div style='text-align: center; padding: 20px; color: #666;'>Select a space to view details</div>"
                )
            
            with gr.Row():
                space_grid = gr.HTML(
                    value="<div style='display: flex; flex-wrap: wrap; gap: 16px; justify-content: center;'>" +
                          "".join([create_space_card(row) for _, row in top_100_spaces.iterrows()]) +
                          "</div>"
                )
                
                space_selection = gr.Radio(
                    choices=[row['id'] for _, row in top_100_spaces.iterrows()],
                    value=None,
                    visible=False
                )
        
        with gr.Tab("About"):
            gr.Markdown("""
            ### Our Tracking System
            
            #### What We Track
            - Daily ranking changes for all Hugging Face Spaces
            - Comprehensive trending scores based on 30-day activity
            - Detailed performance metrics for top 100 Spaces
            - Historical ranking data with daily granularity
            
            #### Key Features
            - **Real-time Rankings**: Stay updated with daily rank changes
            - **Interactive Visualizations**: Track ranking trajectories over time
            - **Trend Analysis**: Identify emerging popular AI applications
            - **Direct Access**: Quick links to explore trending Spaces
            - **Performance Metrics**: Detailed trending scores and statistics
            
            ### Why Use HF Space Ranking Tracker?
            - Discover trending AI demos and applications
            - Monitor your Space's performance and popularity
            - Identify emerging trends in the AI community
            - Make data-driven decisions about your AI projects
            - Stay ahead of the curve in AI application development
            
            Our dashboard provides a comprehensive view of the Hugging Face Spaces ecosystem, helping developers, researchers, and enthusiasts track and understand the dynamics of popular AI applications. Whether you're monitoring your own Space's performance or discovering new trending applications, HF Space Ranking Tracker offers the insights you need.
            
            Experience the pulse of the AI community through our daily updated rankings and discover what's making waves in the world of practical AI applications.
            """)
    
    # JavaScript ์ด๋ฒคํŠธ ์ฒ˜๋ฆฌ
    space_grid.click(
        None,
        None,
        None,
        js="""async (event) => {
            if (event.target.closest('.space-card')) {
                const spaceId = event.target.closest('.space-card').dataset.spaceId;
                document.querySelector(`input[type="radio"][value="${spaceId}"]`).click();
            }
        }"""
    )
    
    space_selection.change(
        fn=update_display,
        inputs=[space_selection],
        outputs=[trend_plot, info_box]
    )

if __name__ == "__main__":
    demo.launch(share=True)