openfree commited on
Commit
abdf7f2
ยท
verified ยท
1 Parent(s): b16d6fc

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +847 -0
app.py ADDED
@@ -0,0 +1,847 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import spaces
3
+ import requests
4
+ import pandas as pd
5
+ import plotly.graph_objects as go
6
+ from datetime import datetime
7
+ import os
8
+ import asyncio
9
+ import aiohttp
10
+
11
+ # Neumorphism CSS ์Šคํƒ€์ผ
12
+ CUSTOM_CSS = """
13
+ /* โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
14
+ ๐Ÿ”˜ NEUMORPHISM ์Šคํƒ€์ผ
15
+ โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• */
16
+ :root {
17
+ --neu-bg: #e0e5ec;
18
+ --neu-shadow-dark: #b8bec5;
19
+ --neu-shadow-light: #ffffff;
20
+ --neu-text: #6d7b8d;
21
+ --neu-text-dark: #5a6677;
22
+ --neu-accent: #FF6B6B;
23
+ --neu-accent-2: #4ECDC4;
24
+ }
25
+
26
+ body, .gradio-container {
27
+ background: var(--neu-bg) !important;
28
+ }
29
+
30
+ .neu-container {
31
+ background: var(--neu-bg);
32
+ padding: 30px;
33
+ border-radius: 25px;
34
+ }
35
+
36
+ .neu-raised {
37
+ background: var(--neu-bg);
38
+ border-radius: 20px;
39
+ box-shadow: 8px 8px 16px var(--neu-shadow-dark), -8px -8px 16px var(--neu-shadow-light);
40
+ padding: 25px;
41
+ margin-bottom: 20px;
42
+ }
43
+
44
+ .neu-inset {
45
+ background: var(--neu-bg);
46
+ border-radius: 15px;
47
+ box-shadow: inset 6px 6px 12px var(--neu-shadow-dark), inset -6px -6px 12px var(--neu-shadow-light);
48
+ padding: 20px;
49
+ }
50
+
51
+ .neu-button, button.primary {
52
+ background: var(--neu-bg) !important;
53
+ border: none !important;
54
+ border-radius: 50px !important;
55
+ padding: 18px 50px !important;
56
+ color: var(--neu-text) !important;
57
+ font-weight: 700 !important;
58
+ box-shadow: 8px 8px 16px var(--neu-shadow-dark), -8px -8px 16px var(--neu-shadow-light) !important;
59
+ transition: all 0.2s ease !important;
60
+ }
61
+
62
+ .neu-button:hover, button.primary:hover {
63
+ box-shadow: 4px 4px 8px var(--neu-shadow-dark), -4px -4px 8px var(--neu-shadow-light) !important;
64
+ transform: translateY(-2px);
65
+ }
66
+
67
+ .neu-button:active, button.primary:active {
68
+ box-shadow: inset 4px 4px 8px var(--neu-shadow-dark), inset -4px -4px 8px var(--neu-shadow-light) !important;
69
+ }
70
+
71
+ .neu-text {
72
+ color: var(--neu-text);
73
+ text-shadow: 2px 2px 4px var(--neu-shadow-light), -1px -1px 3px rgba(0,0,0,0.1);
74
+ }
75
+
76
+ .gradio-container .tabs {
77
+ background: var(--neu-bg) !important;
78
+ }
79
+
80
+ .gradio-container .tab-nav button {
81
+ background: var(--neu-bg) !important;
82
+ border-radius: 15px !important;
83
+ margin: 5px !important;
84
+ box-shadow: 5px 5px 10px var(--neu-shadow-dark), -5px -5px 10px var(--neu-shadow-light) !important;
85
+ color: var(--neu-text) !important;
86
+ font-weight: 600 !important;
87
+ }
88
+
89
+ .gradio-container .tab-nav button.selected {
90
+ box-shadow: inset 4px 4px 8px var(--neu-shadow-dark), inset -4px -4px 8px var(--neu-shadow-light) !important;
91
+ color: var(--neu-accent) !important;
92
+ }
93
+
94
+ #spaces_pie, #models_pie, #spaces_bar, #models_bar {
95
+ min-height: 400px;
96
+ border-radius: 20px;
97
+ box-shadow: 8px 8px 16px var(--neu-shadow-dark), -8px -8px 16px var(--neu-shadow-light);
98
+ background: var(--neu-bg);
99
+ padding: 15px;
100
+ }
101
+
102
+ .card-grid {
103
+ display: grid;
104
+ grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
105
+ gap: 25px;
106
+ padding: 20px;
107
+ }
108
+
109
+ .space-card {
110
+ background: var(--neu-bg);
111
+ border-radius: 20px;
112
+ padding: 25px;
113
+ box-shadow: 8px 8px 16px var(--neu-shadow-dark), -8px -8px 16px var(--neu-shadow-light);
114
+ transition: transform 0.3s ease, box-shadow 0.3s ease;
115
+ }
116
+
117
+ .space-card:hover {
118
+ transform: translateY(-5px);
119
+ box-shadow: 12px 12px 24px var(--neu-shadow-dark), -12px -12px 24px var(--neu-shadow-light);
120
+ }
121
+
122
+ .visit-link {
123
+ display: inline-block;
124
+ padding: 12px 24px;
125
+ background: var(--neu-bg);
126
+ color: var(--neu-text);
127
+ text-decoration: none;
128
+ border-radius: 50px;
129
+ font-weight: 600;
130
+ box-shadow: 5px 5px 10px var(--neu-shadow-dark), -5px -5px 10px var(--neu-shadow-light);
131
+ transition: all 0.2s ease;
132
+ }
133
+
134
+ .visit-link:hover {
135
+ box-shadow: 3px 3px 6px var(--neu-shadow-dark), -3px -3px 6px var(--neu-shadow-light);
136
+ color: var(--neu-accent);
137
+ }
138
+
139
+ .korea-badge {
140
+ display: inline-block;
141
+ padding: 5px 15px;
142
+ background: linear-gradient(145deg, #FF6B6B, #FF8E8E);
143
+ color: white;
144
+ border-radius: 20px;
145
+ font-size: 12px;
146
+ font-weight: 600;
147
+ }
148
+
149
+ .main-title {
150
+ color: var(--neu-text-dark);
151
+ font-size: 2em;
152
+ font-weight: 800;
153
+ text-shadow: 2px 2px 4px var(--neu-shadow-light), -1px -1px 3px rgba(0,0,0,0.1);
154
+ }
155
+
156
+ ::-webkit-scrollbar {
157
+ width: 10px;
158
+ }
159
+
160
+ ::-webkit-scrollbar-track {
161
+ background: var(--neu-bg);
162
+ border-radius: 10px;
163
+ }
164
+
165
+ ::-webkit-scrollbar-thumb {
166
+ background: linear-gradient(145deg, #c8cdd4, #f0f5fc);
167
+ border-radius: 10px;
168
+ }
169
+ """
170
+
171
+ # ZeroGPU ๋”๋ฏธ ํ•จ์ˆ˜
172
+ @spaces.GPU(duration=1)
173
+ def dummy_gpu_function():
174
+ return "GPU initialized"
175
+
176
+ def initialize_app():
177
+ try:
178
+ result = dummy_gpu_function()
179
+ print(f"[ZeroGPU] {result}")
180
+ except Exception as e:
181
+ print(f"[ZeroGPU] Running without GPU: {e}")
182
+ return True
183
+
184
+ app_initialized = initialize_app()
185
+
186
+ HF_TOKEN = os.getenv("HF_TOKEN")
187
+
188
+ # ํ•œ๊ตญ ๊ด€๋ จ ์กฐ์ง/์‚ฌ์šฉ์ž ๊ณ„์ • ๋ชฉ๋ก (๋ชจ๋ธ ๋ฐ ์ŠคํŽ˜์ด์Šค ๊ฒ€์ƒ‰์— ์‚ฌ์šฉ)
189
+ KOREAN_ORGS = [
190
+ "keeperballon", "openfree", "VIDraft", "vidraft", "ginigen", "ginipick",
191
+ "Heartsync", "heartsync", "seawolf2357", "aiqcamp", "aiqtech", "fantaxy",
192
+ "fantos", "immunobiotech", "yokoha", "cutechicken", "kolaslab", "gunship999",
193
+ "moreh", "OnomaAIResearch", "LGAI-EXAONE", "naver-hyperclovax", "naver-ai",
194
+ "kakaocorp", "kakaobrain", "kakaobank", "K-intelligence", "skt",
195
+ "SamsungResearch", "SamsungSAILMontreal", "upstage", "NCSOFT", "LDCC",
196
+ "nari-labs", "etri-vilab", "etri-xainlp", "etri-lirs", "ETRI-XAINLP",
197
+ "Bllossom", "MLP-KTLim", "DILAB-HYU", "nlpai-lab", "kyujinpy",
198
+ "beomi", "maywell", "yanolja", "saltlux", "42dot", "Edentns",
199
+ "snunlp", "SKT-AI", "monologg", "cosmoquester", "krevas",
200
+ "EleutherAI", "kaist-ai", "KAERI-MLP", "dnotitia", "OLAResearch"
201
+ ]
202
+
203
+ target_models = {
204
+ "K-intelligence/Midm-2.0-Mini-Instruct": "https://huggingface.co/K-intelligence/Midm-2.0-Mini-Instruct",
205
+ "K-intelligence/Midm-2.0-Base-Instruct": "https://huggingface.co/K-intelligence/Midm-2.0-Base-Instruct",
206
+ "VIDraft/Qwen3-R1984-30B-A3B": "https://huggingface.co/VIDraft/Qwen3-R1984-30B-A3B",
207
+ "VIDraft/Gemma-3-R1984-1B": "https://huggingface.co/VIDraft/Gemma-3-R1984-1B",
208
+ "VIDraft/Qwen3-R1984-0.6B": "https://huggingface.co/VIDraft/Qwen3-R1984-0.6B",
209
+ "VIDraft/Qwen3-R1984-4B": "https://huggingface.co/VIDraft/Qwen3-R1984-4B",
210
+ "seawolf2357/kim-korea": "https://huggingface.co/seawolf2357/kim-korea",
211
+ "ginipick/QwQ-32B-NF4": "https://huggingface.co/ginipick/QwQ-32B-NF4",
212
+ "naver-hyperclovax/HyperCLOVAX-SEED-Text-Instruct-0.5B": "https://huggingface.co/naver-hyperclovax/HyperCLOVAX-SEED-Text-Instruct-0.5B",
213
+ "naver-hyperclovax/HyperCLOVAX-SEED-Text-Instruct-1.5B": "https://huggingface.co/naver-hyperclovax/HyperCLOVAX-SEED-Text-Instruct-1.5B",
214
+ "naver-hyperclovax/HyperCLOVAX-SEED-Vision-Instruct-3B": "https://huggingface.co/naver-hyperclovax/HyperCLOVAX-SEED-Vision-Instruct-3B",
215
+ "LGAI-EXAONE/EXAONE-3.5-32B-Instruct": "https://huggingface.co/LGAI-EXAONE/EXAONE-3.5-32B-Instruct",
216
+ "LGAI-EXAONE/EXAONE-3.5-2.4B-Instruct": "https://huggingface.co/LGAI-EXAONE/EXAONE-3.5-2.4B-Instruct",
217
+ "LGAI-EXAONE/EXAONE-3.5-7.8B-Instruct": "https://huggingface.co/LGAI-EXAONE/EXAONE-3.5-7.8B-Instruct",
218
+ "LGAI-EXAONE/EXAONE-Deep-32B": "https://huggingface.co/LGAI-EXAONE/EXAONE-Deep-32B",
219
+ "LGAI-EXAONE/EXAONE-Deep-2.4B": "https://huggingface.co/LGAI-EXAONE/EXAONE-Deep-2.4B",
220
+ "LGAI-EXAONE/EXAONE-Deep-7.8B": "https://huggingface.co/LGAI-EXAONE/EXAONE-Deep-7.8B",
221
+ "moreh/Llama-3-Motif-102B-Instruct": "https://huggingface.co/moreh/Llama-3-Motif-102B-Instruct",
222
+ "moreh/Llama-3-Motif-102B": "https://huggingface.co/moreh/Llama-3-Motif-102B",
223
+ "moreh/MoMo-72B-lora-1.8.7-DPO": "https://huggingface.co/moreh/MoMo-72B-lora-1.8.7-DPO",
224
+ "OnomaAIResearch/Illustrious-XL-v2.0": "https://huggingface.co/OnomaAIResearch/Illustrious-XL-v2.0",
225
+ "OnomaAIResearch/Illustrious-Lumina-v0.03": "https://huggingface.co/OnomaAIResearch/Illustrious-Lumina-v0.03",
226
+ "OnomaAIResearch/Illustrious-xl-early-release-v0": "https://huggingface.co/OnomaAIResearch/Illustrious-xl-early-release-v0",
227
+ "OnomaAIResearch/Illustrious-XL-v1.0": "https://huggingface.co/OnomaAIResearch/Illustrious-XL-v1.0",
228
+ "OnomaAIResearch/Illustrious-XL-v1.1": "https://huggingface.co/OnomaAIResearch/Illustrious-XL-v1.1",
229
+ "upstage/solar-pro-preview-instruct": "https://huggingface.co/upstage/solar-pro-preview-instruct",
230
+ "NCSOFT/VARCO-VISION-14B": "https://huggingface.co/NCSOFT/VARCO-VISION-14B",
231
+ "NCSOFT/Llama-VARCO-8B-Instruct": "https://huggingface.co/NCSOFT/Llama-VARCO-8B-Instruct",
232
+ "NCSOFT/VARCO-VISION-14B-HF": "https://huggingface.co/NCSOFT/VARCO-VISION-14B-HF",
233
+ "kakaocorp/kanana-nano-2.1b-base": "https://huggingface.co/kakaocorp/kanana-nano-2.1b-base",
234
+ "kakaocorp/kanana-nano-2.1b-instruct": "https://huggingface.co/kakaocorp/kanana-nano-2.1b-instruct",
235
+ "kakaobrain/kogpt": "https://huggingface.co/kakaobrain/kogpt",
236
+ "nari-labs/Dia-1.6B": "https://huggingface.co/nari-labs/Dia-1.6B",
237
+ "Bllossom/llama-3.2-Korean-Bllossom-3B": "https://huggingface.co/Bllossom/llama-3.2-Korean-Bllossom-3B",
238
+ "MLP-KTLim/llama-3-Korean-Bllossom-8B": "https://huggingface.co/MLP-KTLim/llama-3-Korean-Bllossom-8B",
239
+ "etri-lirs/eagle-3b-preview": "https://huggingface.co/etri-lirs/eagle-3b-preview",
240
+ "etri-xainlp/llama3-8b-dpo_v1": "https://huggingface.co/etri-xainlp/llama3-8b-dpo_v1",
241
+ "etri-xainlp/polyglot-ko-12.8b-instruct": "https://huggingface.co/etri-xainlp/polyglot-ko-12.8b-instruct",
242
+ "LDCC/LDCC-SOLAR-10.7B": "https://huggingface.co/LDCC/LDCC-SOLAR-10.7B",
243
+ "nlpai-lab/KULLM3": "https://huggingface.co/nlpai-lab/KULLM3",
244
+ "nlpai-lab/kullm-polyglot-5.8b-v2": "https://huggingface.co/nlpai-lab/kullm-polyglot-5.8b-v2",
245
+ "yanolja/EEVE-Korean-Instruct-10.8B-v1.0": "https://huggingface.co/yanolja/EEVE-Korean-Instruct-10.8B-v1.0",
246
+ "yanolja/Bookworm-10.7B-v0.4-DPO": "https://huggingface.co/yanolja/Bookworm-10.7B-v0.4-DPO",
247
+ "saltlux/Ko-Llama3-Luxia-8B": "https://huggingface.co/saltlux/Ko-Llama3-Luxia-8B",
248
+ "maywell/Llama-3-Ko-8B-Instruct": "https://huggingface.co/maywell/Llama-3-Ko-8B-Instruct",
249
+ "maywell/Synatra-10.7B-v0.4": "https://huggingface.co/maywell/Synatra-10.7B-v0.4",
250
+ "beomi/Llama-3-Open-Ko-8B-Instruct-preview": "https://huggingface.co/beomi/Llama-3-Open-Ko-8B-Instruct-preview",
251
+ "beomi/Yi-Ko-6B": "https://huggingface.co/beomi/Yi-Ko-6B",
252
+ "kyujinpy/Korean-OpenOrca-v3": "https://huggingface.co/kyujinpy/Korean-OpenOrca-v3",
253
+ "kyujinpy/KO-Platypus2-13B": "https://huggingface.co/kyujinpy/KO-Platypus2-13B",
254
+ "dnotitia/DNA-R1": "https://huggingface.co/dnotitia/DNA-R1",
255
+ "dnotitia/Llama-DNA-1.0-8B-Instruct": "https://huggingface.co/dnotitia/Llama-DNA-1.0-8B-Instruct",
256
+ "Edentns/DataVortexS-10.7B-dpo-v1.0": "https://huggingface.co/Edentns/DataVortexS-10.7B-dpo-v1.0",
257
+ "kaist-ai/prometheus-13b-v1.0": "https://huggingface.co/kaist-ai/prometheus-13b-v1.0",
258
+ "KAERI-MLP/llama-3.1-Korean-AtomicGPT-Bllossom-8B": "https://huggingface.co/KAERI-MLP/llama-3.1-Korean-AtomicGPT-Bllossom-8B",
259
+ "DILAB-HYU/koquality-polyglot-12.8b": "https://huggingface.co/DILAB-HYU/koquality-polyglot-12.8b",
260
+ "EleutherAI/polyglot-ko-1.3b": "https://huggingface.co/EleutherAI/polyglot-ko-1.3b",
261
+ }
262
+
263
+ target_spaces = {
264
+ "ginigen/Fashion-Fit360": "https://huggingface.co/spaces/ginigen/Fashion-Fit360",
265
+ "aiqtech/Nano-Banana-API": "https://huggingface.co/spaces/aiqtech/Nano-Banana-API",
266
+ "ginigen/Nano-Banana-Video": "https://huggingface.co/spaces/ginigen/Nano-Banana-Video",
267
+ "openfree/News-AI": "https://huggingface.co/spaces/openfree/News-AI",
268
+ "openfree/Creative-Arena-Leaderboard": "https://huggingface.co/spaces/openfree/Creative-Arena-Leaderboard",
269
+ "Heartsync/Nano-Banana": "https://huggingface.co/spaces/Heartsync/Nano-Banana",
270
+ "ginigen/webtoon-studio": "https://huggingface.co/spaces/ginigen/webtoon-studio",
271
+ "VIDraft/gpt-oss-RAG": "https://huggingface.co/spaces/VIDraft/gpt-oss-RAG",
272
+ "openfree/OpenAI-gpt-oss": "https://huggingface.co/spaces/openfree/OpenAI-gpt-oss",
273
+ "openfree/AGI-NOVEL": "https://huggingface.co/spaces/openfree/AGI-NOVEL",
274
+ "cutechicken/3D-Airforce-Simulator": "https://huggingface.co/spaces/cutechicken/3D-Airforce-Simulator",
275
+ "ginipick/Private-AI": "https://huggingface.co/spaces/ginipick/Private-AI",
276
+ "openfree/Best-AI": "https://huggingface.co/spaces/openfree/Best-AI",
277
+ "aiqtech/Heatmap-Leaderboard": "https://huggingface.co/spaces/aiqtech/Heatmap-Leaderboard",
278
+ "ginigen/Seedance-Free": "https://huggingface.co/spaces/ginigen/Seedance-Free",
279
+ "openfree/K-AI": "https://huggingface.co/spaces/openfree/K-AI",
280
+ "VIDraft/SOMA-AGI": "https://huggingface.co/spaces/VIDraft/SOMA-AGI",
281
+ "openfree/AI": "https://huggingface.co/spaces/openfree/AI",
282
+ "openfree/Chart-GPT": "https://huggingface.co/spaces/openfree/Chart-GPT",
283
+ "fantaxy/fantasy-novel": "https://huggingface.co/spaces/fantaxy/fantasy-novel",
284
+ "VIDraft/Gemma-3-R1984-1B": "https://huggingface.co/spaces/VIDraft/Gemma-3-R1984-1B",
285
+ "ginigen/FLUX-Ghibli-LoRA2": "https://huggingface.co/spaces/ginigen/FLUX-Ghibli-LoRA2",
286
+ "ginigen/Flux-VIDEO": "https://huggingface.co/spaces/ginigen/Flux-VIDEO",
287
+ "aiqcamp/deepseek-r1-0528": "https://huggingface.co/spaces/aiqcamp/deepseek-r1-0528",
288
+ "VIDraft/BAGEL-Websearch": "https://huggingface.co/spaces/VIDraft/BAGEL-Websearch",
289
+ "ginigen/3D-LLAMA-V1": "https://huggingface.co/spaces/ginigen/3D-LLAMA-V1",
290
+ "ginipick/Change-Hair": "https://huggingface.co/spaces/ginipick/Change-Hair",
291
+ "VIDraft/Voice-Clone-Podcast": "https://huggingface.co/spaces/VIDraft/Voice-Clone-Podcast",
292
+ "ginipick/PDF-EXAM": "https://huggingface.co/spaces/ginipick/PDF-EXAM",
293
+ "openfree/Naming": "https://huggingface.co/spaces/openfree/Naming",
294
+ "VIDraft/ACE-Singer": "https://huggingface.co/spaces/VIDraft/ACE-Singer",
295
+ "openfree/Live-Podcast": "https://huggingface.co/spaces/openfree/Live-Podcast",
296
+ "openfree/AI-Podcast": "https://huggingface.co/spaces/openfree/AI-Podcast",
297
+ "ginipick/AI-BOOK": "https://huggingface.co/spaces/ginipick/AI-BOOK",
298
+ "openfree/Web-Manager": "https://huggingface.co/spaces/openfree/Web-Manager",
299
+ "openfree/Game-Gallery": "https://huggingface.co/spaces/openfree/Game-Gallery",
300
+ "openfree/RPG-GAME": "https://huggingface.co/spaces/openfree/RPG-GAME",
301
+ "openfree/Evolution-Simulation": "https://huggingface.co/spaces/openfree/Evolution-Simulation",
302
+ "ginigen/3D-VIDEO": "https://huggingface.co/spaces/ginigen/3D-VIDEO",
303
+ "ginipick/Pharmacy": "https://huggingface.co/spaces/ginipick/Pharmacy",
304
+ "openfree/Battle-Royale-GAME": "https://huggingface.co/spaces/openfree/Battle-Royale-GAME",
305
+ "openfree/repo-graph": "https://huggingface.co/spaces/openfree/repo-graph",
306
+ "openfree/Chain-of-Recursive-Thoughts": "https://huggingface.co/spaces/openfree/Chain-of-Recursive-Thoughts",
307
+ "ginigen/Mistral-Perflexity": "https://huggingface.co/spaces/ginigen/Mistral-Perflexity",
308
+ "ginigen/Every-Text": "https://huggingface.co/spaces/ginigen/Every-Text",
309
+ "openfree/svg": "https://huggingface.co/spaces/openfree/svg",
310
+ "VIDraft/phi-4-reasoning-plus": "https://huggingface.co/spaces/VIDraft/phi-4-reasoning-plus",
311
+ "ginigen/VisualCloze": "https://huggingface.co/spaces/ginigen/VisualCloze",
312
+ "ginigen/framepack-i2v": "https://huggingface.co/spaces/ginigen/framepack-i2v",
313
+ "fantos/Physics-Playground": "https://huggingface.co/spaces/fantos/Physics-Playground",
314
+ "fantos/EveryText": "https://huggingface.co/spaces/fantos/EveryText",
315
+ "ginipick/Qwen3-32B": "https://huggingface.co/spaces/ginipick/Qwen3-32B",
316
+ "ginipick/Qwen3-235B-A22B": "https://huggingface.co/spaces/ginipick/Qwen3-235B-A22B",
317
+ "keeperballon/vibe-coding-tetris": "https://huggingface.co/spaces/keeperballon/vibe-coding-tetris",
318
+ "keeperballon/multi-llm": "https://huggingface.co/spaces/keeperballon/multi-llm",
319
+ "VIDraft/Qwen3-8B": "https://huggingface.co/spaces/VIDraft/Qwen3-8B",
320
+ "ginigen/interior-design": "https://huggingface.co/spaces/ginigen/interior-design",
321
+ "ginigen/perflexity-clone": "https://huggingface.co/spaces/ginigen/perflexity-clone",
322
+ "ginigen/blogger": "https://huggingface.co/spaces/ginigen/blogger",
323
+ "openfree/Badge": "https://huggingface.co/spaces/openfree/Badge",
324
+ "openfree/ZeroGPU-Leader": "https://huggingface.co/spaces/openfree/ZeroGPU-Leader",
325
+ "cutechicken/World-of-Tank-GAME": "https://huggingface.co/spaces/cutechicken/World-of-Tank-GAME",
326
+ "openfree/Llama-4-Maverick-17B-Research": "https://huggingface.co/spaces/openfree/Llama-4-Maverick-17B-Research",
327
+ "fantaxy/Model-Leaderboard": "https://huggingface.co/spaces/fantaxy/Model-Leaderboard",
328
+ "ginigen/FLUX-Open-Ghibli-Studio": "https://huggingface.co/spaces/ginigen/FLUX-Open-Ghibli-Studio",
329
+ "openfree/Gemma-3-R1984-12B": "https://huggingface.co/spaces/openfree/Gemma-3-R1984-12B",
330
+ "openfree/Stock-Trading-Analysis": "https://huggingface.co/spaces/openfree/Stock-Trading-Analysis",
331
+ "aiqtech/Contributors-Leaderboard": "https://huggingface.co/spaces/aiqtech/Contributors-Leaderboard",
332
+ "VIDraft/Gemma-3-R1984-27B": "https://huggingface.co/spaces/VIDraft/Gemma-3-R1984-27B",
333
+ "openfree/Deepseek-v3-0324-Research": "https://huggingface.co/spaces/openfree/Deepseek-v3-0324-Research",
334
+ "openfree/Korean-Exam-Leaderboard": "https://huggingface.co/spaces/openfree/Korean-Exam-Leaderboard",
335
+ "openfree/Idea-Transformer": "https://huggingface.co/spaces/openfree/Idea-Transformer",
336
+ "VIDraft/Unique3D": "https://huggingface.co/spaces/VIDraft/Unique3D",
337
+ "openfree/Compare-RAG-CHAT": "https://huggingface.co/spaces/openfree/Compare-RAG-CHAT",
338
+ "openfree/AgentX-Travel": "https://huggingface.co/spaces/openfree/AgentX-Travel",
339
+ "openfree/SonicOrbit": "https://huggingface.co/spaces/openfree/SonicOrbit",
340
+ "VIDraft/Space-Leaderboard": "https://huggingface.co/spaces/VIDraft/Space-Leaderboard",
341
+ "ginipick/3D-GAME": "https://huggingface.co/spaces/ginipick/3D-GAME",
342
+ "ginigen/Graph-Mind": "https://huggingface.co/spaces/ginigen/Graph-Mind",
343
+ "openfree/deepseek_r1_API": "https://huggingface.co/spaces/openfree/deepseek_r1_API",
344
+ "openfree/Mouse2-HF": "https://huggingface.co/spaces/openfree/Mouse2-HF",
345
+ "ginipick/open_Deep-Research": "https://huggingface.co/spaces/ginipick/open_Deep-Research",
346
+ "ginigen/LLaDA": "https://huggingface.co/spaces/ginigen/LLaDA",
347
+ "VIDraft/PHI4-Multimodal": "https://huggingface.co/spaces/VIDraft/PHI4-Multimodal",
348
+ "openfree/Datasets-Convertor": "https://huggingface.co/spaces/openfree/Datasets-Convertor",
349
+ "ginigen/Ovis2-8B": "https://huggingface.co/spaces/ginigen/Ovis2-8B",
350
+ "ginigen/FLUX-Eternity": "https://huggingface.co/spaces/ginigen/FLUX-Eternity",
351
+ "ginigen/OmniParser-v2-pro": "https://huggingface.co/spaces/ginigen/OmniParser-v2-pro",
352
+ "ginigen/panorama-images": "https://huggingface.co/spaces/ginigen/panorama-images",
353
+ "ginigen/Celebrity": "https://huggingface.co/spaces/ginigen/Celebrity",
354
+ "ginigen/Fashion-Pose-Control": "https://huggingface.co/spaces/ginigen/Fashion-Pose-Control",
355
+ "ginigen/VoiceClone-TTS": "https://huggingface.co/spaces/ginigen/VoiceClone-TTS",
356
+ "openfree/Article-Generator": "https://huggingface.co/spaces/openfree/Article-Generator",
357
+ "openfree/chess": "https://huggingface.co/spaces/openfree/chess",
358
+ "fantos/Panorama": "https://huggingface.co/spaces/fantos/Panorama",
359
+ "ginigen/Multi-LoRAgen": "https://huggingface.co/spaces/ginigen/Multi-LoRAgen",
360
+ "ginigen/canvas-studio": "https://huggingface.co/spaces/ginigen/canvas-studio",
361
+ "fantos/Magic-Drawings": "https://huggingface.co/spaces/fantos/Magic-Drawings",
362
+ "ginigen/Lumina-Image-PLUS": "https://huggingface.co/spaces/ginigen/Lumina-Image-PLUS",
363
+ "VIDraft/mouse-webgen": "https://huggingface.co/spaces/VIDraft/mouse-webgen",
364
+ "immunobiotech/MUSIC-Jukebox": "https://huggingface.co/spaces/immunobiotech/MUSIC-Jukebox",
365
+ "kolaslab/Binaural-Beat-Generator": "https://huggingface.co/spaces/kolaslab/Binaural-Beat-Generator",
366
+ "ginigen/Flux-LayerDiffuse": "https://huggingface.co/spaces/ginigen/Flux-LayerDiffuse",
367
+ "VIDraft/Portrait-Animation": "https://huggingface.co/spaces/VIDraft/Portrait-Animation",
368
+ "ginigen/text3d-r1": "https://huggingface.co/spaces/ginigen/text3d-r1",
369
+ "immunobiotech/drug-discovery": "https://huggingface.co/spaces/immunobiotech/drug-discovery",
370
+ "openfree/VisionOCR-Chat": "https://huggingface.co/spaces/openfree/VisionOCR-Chat",
371
+ "immunobiotech/MICHELIN": "https://huggingface.co/spaces/immunobiotech/MICHELIN",
372
+ "ginipick/PharmAI-Korea": "https://huggingface.co/spaces/ginipick/PharmAI-Korea",
373
+ "ginigen/MagicFace-V3": "https://huggingface.co/spaces/ginigen/MagicFace-V3",
374
+ "aiqcamp/MindMap": "https://huggingface.co/spaces/aiqcamp/MindMap",
375
+ "ginigen/3D-LLAMA": "https://huggingface.co/spaces/ginigen/3D-LLAMA",
376
+ "openfree/VectorFlow": "https://huggingface.co/spaces/openfree/VectorFlow",
377
+ "openfree/webtoon-gen": "https://huggingface.co/spaces/openfree/webtoon-gen",
378
+ "VIDraft/topic-prediction": "https://huggingface.co/spaces/VIDraft/topic-prediction",
379
+ "openfree/MoneyRadar2": "https://huggingface.co/spaces/openfree/MoneyRadar2",
380
+ "openfree/trending-board-2025": "https://huggingface.co/spaces/openfree/trending-board-2025",
381
+ "VIDraft/PapersImpact": "https://huggingface.co/spaces/VIDraft/PapersImpact",
382
+ "VIDraft/EveryRAG": "https://huggingface.co/spaces/VIDraft/EveryRAG",
383
+ "ginipick/Any3D": "https://huggingface.co/spaces/ginipick/Any3D",
384
+ "ginigen/Canvas-pro": "https://huggingface.co/spaces/ginigen/Canvas-pro",
385
+ "openfree/image-to-vector": "https://huggingface.co/spaces/openfree/image-to-vector",
386
+ "ginipick/QR-Canvas-plus": "https://huggingface.co/spaces/ginipick/QR-Canvas-plus",
387
+ "openfree/Korean-Leaderboard-2025": "https://huggingface.co/spaces/openfree/Korean-Leaderboard-2025",
388
+ "ginipick/DeepSeekR1-LIVE": "https://huggingface.co/spaces/ginipick/DeepSeekR1-LIVE",
389
+ "ginigen/ColPali-multi": "https://huggingface.co/spaces/ginigen/ColPali-multi",
390
+ "ginigen/Janus-Pro-7B": "https://huggingface.co/spaces/ginigen/Janus-Pro-7B",
391
+ "ginigen/Animagine": "https://huggingface.co/spaces/ginigen/Animagine",
392
+ "ginipick/OpenSUNO": "https://huggingface.co/spaces/ginipick/OpenSUNO",
393
+ "openfree/PDF-RAG": "https://huggingface.co/spaces/openfree/PDF-RAG",
394
+ "fantos/Ranking-Tracker": "https://huggingface.co/spaces/fantos/Ranking-Tracker",
395
+ "aiqcamp/Multilingual-Images": "https://huggingface.co/spaces/aiqcamp/Multilingual-Images",
396
+ "aiqcamp/Gemini2-Flash-Thinking": "https://huggingface.co/spaces/aiqcamp/Gemini2-Flash-Thinking",
397
+ "kolaslab/8bit-gamemusic": "https://huggingface.co/spaces/kolaslab/8bit-gamemusic",
398
+ "openfree/pepe": "https://huggingface.co/spaces/openfree/pepe",
399
+ "openfree/MoneyRadar": "https://huggingface.co/spaces/openfree/MoneyRadar",
400
+ "ginipick/QR-Canvas": "https://huggingface.co/spaces/ginipick/QR-Canvas",
401
+ "openfree/MagicFace": "https://huggingface.co/spaces/openfree/MagicFace",
402
+ "openfree/pick-spaces": "https://huggingface.co/spaces/openfree/pick-spaces",
403
+ "aiqcamp/diagram": "https://huggingface.co/spaces/aiqcamp/diagram",
404
+ "openfree/korea-president-yoon": "https://huggingface.co/spaces/openfree/korea-president-yoon",
405
+ "VIDraft/PaperImpact": "https://huggingface.co/spaces/VIDraft/PaperImpact",
406
+ "openfree/CryptoVision": "https://huggingface.co/spaces/openfree/CryptoVision",
407
+ "gunship999/Gunship-3D-FPS": "https://huggingface.co/spaces/gunship999/Gunship-3D-FPS",
408
+ "fantos/VoiceClone": "https://huggingface.co/spaces/fantos/VoiceClone",
409
+ "VIDraft/ChemGenesis": "https://huggingface.co/spaces/VIDraft/ChemGenesis",
410
+ "openfree/webtoon": "https://huggingface.co/spaces/openfree/webtoon",
411
+ "kolaslab/Quantum": "https://huggingface.co/spaces/kolaslab/Quantum",
412
+ "openfree/ProteinGenesis": "https://huggingface.co/spaces/openfree/ProteinGenesis",
413
+ "openfree/2025saju": "https://huggingface.co/spaces/openfree/2025saju",
414
+ "kolaslab/VisionART": "https://huggingface.co/spaces/kolaslab/VisionART",
415
+ "ginigen/CANVAS-o3": "https://huggingface.co/spaces/ginigen/CANVAS-o3",
416
+ "kolaslab/world-sdr": "https://huggingface.co/spaces/kolaslab/world-sdr",
417
+ "openfree/ultpixgen": "https://huggingface.co/spaces/openfree/ultpixgen",
418
+ "ginigen/theater": "https://huggingface.co/spaces/ginigen/theater",
419
+ "VIDraft/stock": "https://huggingface.co/spaces/VIDraft/stock",
420
+ "ginipick/FLUX-Prompt-Generator": "https://huggingface.co/spaces/ginipick/FLUX-Prompt-Generator",
421
+ "ginigen/Dokdo": "https://huggingface.co/spaces/ginigen/Dokdo",
422
+ "aiqcamp/imagemagic": "https://huggingface.co/spaces/aiqcamp/imagemagic",
423
+ "openfree/ColorRevive": "https://huggingface.co/spaces/openfree/ColorRevive",
424
+ "VIDraft/RAGOndevice": "https://huggingface.co/spaces/VIDraft/RAGOndevice",
425
+ "ginigen/FLUXllama-Multilingual": "https://huggingface.co/spaces/ginigen/FLUXllama-Multilingual",
426
+ "aiqcamp/Fashion-FLUX": "https://huggingface.co/spaces/aiqcamp/Fashion-FLUX",
427
+ "ginipick/StyleGen": "https://huggingface.co/spaces/ginipick/StyleGen",
428
+ "openfree/StoryStar": "https://huggingface.co/spaces/openfree/StoryStar",
429
+ "openfree/Korean-Leaderboard": "https://huggingface.co/spaces/openfree/Korean-Leaderboard",
430
+ "ginipick/FLUXllama": "https://huggingface.co/spaces/ginipick/FLUXllama",
431
+ "ginipick/SORA-3D": "https://huggingface.co/spaces/ginipick/SORA-3D",
432
+ "fantaxy/Sound-AI-SFX": "https://huggingface.co/spaces/fantaxy/Sound-AI-SFX",
433
+ "ginigen/Canvas": "https://huggingface.co/spaces/ginigen/Canvas",
434
+ "ginipick/time-machine": "https://huggingface.co/spaces/ginipick/time-machine",
435
+ "openfree/Tetris-Game": "https://huggingface.co/spaces/openfree/Tetris-Game",
436
+ "openfree/everychat": "https://huggingface.co/spaces/openfree/everychat",
437
+ "VIDraft/mouse1": "https://huggingface.co/spaces/VIDraft/mouse1",
438
+ "kolaslab/alpha-go": "https://huggingface.co/spaces/kolaslab/alpha-go",
439
+ "ginipick/text3d": "https://huggingface.co/spaces/ginipick/text3d",
440
+ "openfree/trending-board": "https://huggingface.co/spaces/openfree/trending-board",
441
+ "cutechicken/tankwar": "https://huggingface.co/spaces/cutechicken/tankwar",
442
+ "openfree/game-jewel": "https://huggingface.co/spaces/openfree/game-jewel",
443
+ "VIDraft/mouse-chat": "https://huggingface.co/spaces/VIDraft/mouse-chat",
444
+ "ginipick/AccDiffusion": "https://huggingface.co/spaces/ginipick/AccDiffusion",
445
+ "openfree/GiniGEN": "https://huggingface.co/spaces/openfree/GiniGEN",
446
+ "openfree/trending-news-24": "https://huggingface.co/spaces/openfree/trending-news-24",
447
+ "ginipick/Realtime-FLUX": "https://huggingface.co/spaces/ginipick/Realtime-FLUX",
448
+ "VIDraft/prime-number": "https://huggingface.co/spaces/VIDraft/prime-number",
449
+ "kolaslab/zombie-game": "https://huggingface.co/spaces/kolaslab/zombie-game",
450
+ "kolaslab/shooting": "https://huggingface.co/spaces/kolaslab/shooting",
451
+ "VIDraft/Mouse-Hackathon": "https://huggingface.co/spaces/VIDraft/Mouse-Hackathon",
452
+ "cutechicken/TankWar3D": "https://huggingface.co/spaces/cutechicken/TankWar3D",
453
+ "kolaslab/RC4-EnDecoder": "https://huggingface.co/spaces/kolaslab/RC4-EnDecoder",
454
+ "kolaslab/simulator": "https://huggingface.co/spaces/kolaslab/simulator",
455
+ "kolaslab/calculator": "https://huggingface.co/spaces/kolaslab/calculator",
456
+
457
+ # ๊ธฐ์—… ๊ด€๋ จ ์ŠคํŽ˜์ด์Šค
458
+ "nari-labs/Dia-1.6B": "https://huggingface.co/spaces/nari-labs/Dia-1.6B",
459
+ "upstage/open-ko-llm-leaderboard": "https://huggingface.co/spaces/upstage/open-ko-llm-leaderboard",
460
+ "LGAI-EXAONE/EXAONE-3.5-Instruct-Demo": "https://huggingface.co/spaces/LGAI-EXAONE/EXAONE-3.5-Instruct-Demo",
461
+ "LeeSangHoon/HierSpeech_TTS": "https://huggingface.co/spaces/LeeSangHoon/HierSpeech_TTS",
462
+ "etri-vilab/Ko-LLaVA": "https://huggingface.co/spaces/etri-vilab/Ko-LLaVA",
463
+ "etri-vilab/KOALA": "https://huggingface.co/spaces/etri-vilab/KOALA",
464
+ "naver-clova-ix/donut-base-finetuned-cord-v2": "https://huggingface.co/spaces/naver-clova-ix/donut-base-finetuned-cord-v2",
465
+ "NCSOFT/VARCO_Arena": "https://huggingface.co/spaces/NCSOFT/VARCO_Arena",
466
+ }
467
+
468
+ def get_korea_models():
469
+ """Korea ๊ด€๋ จ ๋ชจ๋ธ ๊ฒ€์ƒ‰"""
470
+ params = {"search": "korea", "full": "True", "config": "True", "limit": 1000}
471
+ try:
472
+ response = requests.get("https://huggingface.co/api/models", headers={'Accept': 'application/json'}, params=params)
473
+ if response.status_code == 200:
474
+ return response.json()
475
+ return []
476
+ except Exception as e:
477
+ print(f"Error fetching Korea models: {str(e)}")
478
+ return []
479
+
480
+ def get_all_models(limit=3000):
481
+ """๋ชจ๋“  ๋ชจ๋ธ๊ณผ Korea ๊ด€๋ จ ๋ชจ๋ธ ๊ฐ€์ ธ์˜ค๊ธฐ"""
482
+ all_models = []
483
+ page_size = 1000
484
+
485
+ for offset in range(0, limit, page_size):
486
+ params = {'limit': min(page_size, limit - offset), 'full': 'True', 'config': 'True', 'offset': offset}
487
+ response = requests.get("https://huggingface.co/api/models", headers={'Accept': 'application/json'}, params=params)
488
+ if response.status_code == 200:
489
+ all_models.extend(response.json())
490
+ else:
491
+ break
492
+
493
+ korea_response = requests.get("https://huggingface.co/api/models", headers={'Accept': 'application/json'},
494
+ params={"search": "korea", "full": "True", "config": "True", "limit": limit})
495
+ if korea_response.status_code == 200:
496
+ korea_models = korea_response.json()
497
+ existing_ids = {model.get('id', '') for model in all_models}
498
+ for model in korea_models:
499
+ if model.get('id', '') not in existing_ids:
500
+ all_models.append(model)
501
+
502
+ return all_models[:limit]
503
+
504
+ async def fetch_model_data(session, model_id):
505
+ url = f"https://huggingface.co/api/models/{model_id.strip('/')}"
506
+ try:
507
+ async with session.get(url, headers={'Accept': 'application/json'}) as response:
508
+ if response.status == 200:
509
+ return await response.json()
510
+ return None
511
+ except:
512
+ return None
513
+
514
+ async def fetch_all_target_models(model_ids):
515
+ async with aiohttp.ClientSession() as session:
516
+ tasks = [fetch_model_data(session, model_id) for model_id in model_ids]
517
+ return await asyncio.gather(*tasks)
518
+
519
+ def create_error_plot():
520
+ fig = go.Figure()
521
+ fig.add_annotation(text="๋ฐ์ดํ„ฐ๋ฅผ ๋ถˆ๋Ÿฌ์˜ฌ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค", xref="paper", yref="paper", x=0.5, y=0.5, showarrow=False, font=dict(size=20))
522
+ fig.update_layout(title="Error Loading Data", height=400, paper_bgcolor='#e0e5ec', plot_bgcolor='#e0e5ec')
523
+ return fig
524
+
525
+ def get_models_data(progress=gr.Progress()):
526
+ def calculate_rank(model_id, all_global_models, korea_models):
527
+ global_rank = next((idx for idx, m in enumerate(all_global_models, 1) if m.get('id', '').strip() == model_id.strip()), None)
528
+ is_korea = any(m.get('id', '').strip() == model_id.strip() for m in korea_models)
529
+ if is_korea:
530
+ korea_rank = next((idx for idx, m in enumerate(korea_models, 1) if m.get('id', '').strip() == model_id.strip()), None)
531
+ if korea_rank:
532
+ return min(global_rank or 3001, korea_rank + 1000), True
533
+ return global_rank if global_rank else 'Not in top 3000', is_korea
534
+
535
+ try:
536
+ progress(0, desc="Fetching models...")
537
+
538
+ all_global_models = get_all_models(limit=3000)
539
+ korea_models = get_korea_models()
540
+
541
+ fig = go.Figure()
542
+
543
+ target_model_ids = set(target_models.keys())
544
+ extra_model_ids = set()
545
+ for m in all_global_models:
546
+ model_id = m.get('id', '')
547
+ if isinstance(model_id, str):
548
+ for org in KOREAN_ORGS:
549
+ if model_id.lower().startswith(org.lower() + "/"):
550
+ extra_model_ids.add(model_id)
551
+ break
552
+
553
+ final_model_ids = target_model_ids.union(extra_model_ids)
554
+ model_results = asyncio.run(fetch_all_target_models(final_model_ids))
555
+
556
+ filtered_models = []
557
+ for model_id, model_data in zip(final_model_ids, model_results):
558
+ if model_data is not None:
559
+ rank, is_korea = calculate_rank(model_id, all_global_models, korea_models)
560
+ filtered_models.append({
561
+ 'id': model_id, 'global_rank': rank, 'downloads': model_data.get('downloads', 0),
562
+ 'likes': model_data.get('likes', 0), 'title': model_data.get('title', 'No Title'), 'is_korea': is_korea
563
+ })
564
+ else:
565
+ filtered_models.append({
566
+ 'id': model_id, 'global_rank': 'Not in top 3000', 'downloads': 0,
567
+ 'likes': 0, 'title': 'No Title', 'is_korea': False
568
+ })
569
+
570
+ filtered_models.sort(key=lambda x: x['global_rank'] if isinstance(x['global_rank'], (int, float)) else float('inf'))
571
+ valid_models = [m for m in filtered_models if isinstance(m['global_rank'], (int, float))]
572
+
573
+ if valid_models:
574
+ fig.add_trace(go.Bar(
575
+ x=[m['id'] for m in valid_models],
576
+ y=[3001 - m['global_rank'] for m in valid_models],
577
+ text=[f"Rank: #{m['global_rank']}<br>Downloads: {format(m['downloads'], ',')}<br>Likes: {format(m['likes'], ',')}" for m in valid_models],
578
+ textposition='auto',
579
+ marker_color=['rgba(255,107,107,0.8)' if m['is_korea'] else 'rgba(78,205,196,0.8)' for m in valid_models]
580
+ ))
581
+ fig.update_layout(
582
+ title={'text': "๐Ÿ† HuggingFace Models Global Rankings", 'font': {'size': 24, 'color': '#5a6677'}},
583
+ xaxis_title="Model ID", yaxis_title="Global Rank",
584
+ yaxis=dict(ticktext=[f"#{i}" for i in range(1, 3001, 100)], tickvals=[3001 - i for i in range(1, 3001, 100)], range=[0, 3000]),
585
+ height=800, showlegend=False, template='plotly_white', xaxis_tickangle=-45,
586
+ paper_bgcolor='rgba(224,229,236,0.5)', plot_bgcolor='rgba(224,229,236,0.3)'
587
+ )
588
+
589
+ html_content = f"""
590
+ <div class='neu-container'>
591
+ <h2 class='main-title'>๐Ÿค– Models Rankings (Up to #3000)</h2>
592
+ <div class='card-grid'>
593
+ """
594
+ for model in filtered_models:
595
+ rank_display = f"Global Rank #{model['global_rank']}" if isinstance(model['global_rank'], (int, float)) else "Not in top 3000"
596
+ korea_badge = "<span class='korea-badge'>๐Ÿ‡ฐ๐Ÿ‡ท Korea</span>" if model['is_korea'] else ""
597
+ model_url = target_models.get(model['id'], f"https://huggingface.co/{model['id']}")
598
+ html_content += f"""
599
+ <div class='space-card' style='{"border-left: 4px solid #FF6B6B;" if model["is_korea"] else ""}'>
600
+ <h3 style='color: #5a6677; font-size: 16px;'>{rank_display}</h3>
601
+ <h4 style='color: #6d7b8d; font-size: 14px;'>{model['id']}</h4>
602
+ <p>{korea_badge}</p>
603
+ <p style='color: #6d7b8d;'>โฌ‡๏ธ {format(model['downloads'], ',')} | ๐Ÿ‘ {format(model['likes'], ',')}</p>
604
+ <a href='{model_url}' target='_blank' class='visit-link'>Visit ๐Ÿ”—</a>
605
+ </div>"""
606
+ html_content += "</div></div>"
607
+
608
+ df = pd.DataFrame([{
609
+ 'Global Rank': f"#{m['global_rank']}" if isinstance(m['global_rank'], (int, float)) else m['global_rank'],
610
+ 'Model ID': m['id'], 'Title': m['title'], 'Downloads': format(m['downloads'], ','),
611
+ 'Likes': format(m['likes'], ','), 'Korea': '๐Ÿ‡ฐ๐Ÿ‡ท' if m['is_korea'] else '',
612
+ 'URL': target_models.get(m['id'], f"https://huggingface.co/{m['id']}")
613
+ } for m in filtered_models])
614
+
615
+ progress(1.0, desc="Complete!")
616
+ return fig, html_content, df
617
+ except Exception as e:
618
+ return create_error_plot(), f"<div class='neu-container'><p>Error: {str(e)}</p></div>", pd.DataFrame()
619
+
620
+ def get_spaces_data(sort_type="trending", progress=gr.Progress()):
621
+ """์ŠคํŽ˜์ด์Šค ๋ฐ์ดํ„ฐ ๊ฐ€์ ธ์˜ค๊ธฐ"""
622
+ url = "https://huggingface.co/api/spaces"
623
+ params = {'full': 'true', 'limit': 1000}
624
+ if sort_type == "modes":
625
+ params['sort'] = 'likes'
626
+
627
+ try:
628
+ progress(0, desc=f"Fetching {sort_type} spaces data...")
629
+ response = requests.get(url, params=params)
630
+ response.raise_for_status()
631
+ all_spaces = response.json()
632
+
633
+ space_ranks = {}
634
+ for idx, space in enumerate(all_spaces, 1):
635
+ space_id = space.get('id', '')
636
+ if space_id in target_spaces or any(space_id.lower().startswith(org.lower() + "/") for org in KOREAN_ORGS):
637
+ space['rank'] = idx
638
+ space_ranks[space_id] = space
639
+
640
+ spaces = sorted([space_ranks[sid] for sid in space_ranks], key=lambda x: x['rank'])
641
+
642
+ progress(0.3, desc="Creating visualization...")
643
+
644
+ fig = go.Figure()
645
+ if spaces:
646
+ fig.add_trace(go.Bar(
647
+ x=[s['id'] for s in spaces],
648
+ y=[s['rank'] for s in spaces],
649
+ text=[f"Rank: {s['rank']}<br>Likes: {s.get('likes', 0)}" for s in spaces],
650
+ textposition='auto',
651
+ marker_color='rgba(158,202,225,0.8)'
652
+ ))
653
+
654
+ fig.update_layout(
655
+ title={'text': f'๐Ÿš€ HuggingFace Spaces {sort_type.title()} Rankings (Top 500)', 'font': {'size': 24, 'color': '#5a6677'}},
656
+ xaxis_title='Space ID', yaxis_title='Rank',
657
+ yaxis=dict(autorange='reversed', tickmode='array', ticktext=[str(i) for i in range(1, 501, 20)], tickvals=[i for i in range(1, 501, 20)], range=[1, 500]),
658
+ height=800, showlegend=False, template='plotly_white', xaxis_tickangle=-45,
659
+ paper_bgcolor='rgba(224,229,236,0.5)', plot_bgcolor='rgba(224,229,236,0.3)'
660
+ )
661
+
662
+ progress(0.6, desc="Creating space cards...")
663
+
664
+ html_content = f"""
665
+ <div class='neu-container'>
666
+ <h2 class='main-title'>๐Ÿš€ {sort_type.title()} Rankings</h2>
667
+ <div class='card-grid'>
668
+ """
669
+ for space in spaces:
670
+ space_id = space['id']
671
+ title = space.get('cardData', {}).get('title') or space.get('title', 'No Title')
672
+ likes = space.get('likes', 0)
673
+ space_url = target_spaces.get(space_id, f"https://huggingface.co/spaces/{space_id}")
674
+ html_content += f"""
675
+ <div class='space-card'>
676
+ <h3 style='color: #5a6677;'>Rank #{space['rank']} - {space_id}</h3>
677
+ <h4 style='color: #2980b9; font-size: 1.1em;'>{title}</h4>
678
+ <p style='color: #6d7b8d;'>๐Ÿ‘ Likes: {likes}</p>
679
+ <a href='{space_url}' target='_blank' class='visit-link'>Visit Space ๐Ÿ”—</a>
680
+ </div>"""
681
+ html_content += "</div></div>"
682
+
683
+ df = pd.DataFrame([{
684
+ 'Rank': s['rank'], 'Space ID': s['id'],
685
+ 'Title': s.get('cardData', {}).get('title') or s.get('title', 'No Title'),
686
+ 'Likes': s.get('likes', 0),
687
+ 'URL': target_spaces.get(s['id'], f"https://huggingface.co/spaces/{s['id']}")
688
+ } for s in spaces])
689
+
690
+ progress(1.0, desc="Complete!")
691
+ return fig, html_content, df
692
+ except Exception as e:
693
+ return create_error_plot(), f'<div class="neu-container" style="color: red; padding: 20px;">Error: {str(e)}</div>', pd.DataFrame()
694
+
695
+ def create_registration_bar_chart(data, type_name="Spaces"):
696
+ try:
697
+ top_limit = 500 if type_name == "Spaces" else 3000
698
+ if isinstance(data, pd.DataFrame):
699
+ if type_name == "Models":
700
+ data = data[data['Global Rank'].apply(lambda x: isinstance(x, str) and x.startswith('#'))]
701
+ data = data[data['Global Rank'].apply(lambda x: int(str(x).replace('#', '')) <= top_limit)]
702
+ else:
703
+ data = data[data['Rank'].apply(lambda x: isinstance(x, (int, float)) and x <= top_limit)]
704
+ id_col = 'Space ID' if type_name == "Spaces" else 'Model ID'
705
+ registrations = data[id_col].apply(lambda x: x.split('/')[0]).value_counts()
706
+ else:
707
+ registrations = pd.Series({})
708
+
709
+ registrations = registrations.sort_values(ascending=False)
710
+
711
+ fig = go.Figure(data=[go.Bar(
712
+ x=registrations.index, y=registrations.values,
713
+ text=registrations.values, textposition='auto',
714
+ marker_color='#FF6B6B'
715
+ )])
716
+ fig.update_layout(
717
+ title=f"Korean {type_name} by Creator (Top {top_limit})",
718
+ xaxis_title="Creator ID", yaxis_title="Count",
719
+ showlegend=False, height=400, width=700,
720
+ paper_bgcolor='#e0e5ec', plot_bgcolor='rgba(224,229,236,0.3)'
721
+ )
722
+ return fig
723
+ except:
724
+ return go.Figure()
725
+
726
+ def create_pie_chart(data, total_count, type_name="Spaces"):
727
+ try:
728
+ top_limit = 500 if type_name == "Spaces" else 3000
729
+ if isinstance(data, pd.DataFrame):
730
+ if type_name == "Models":
731
+ korean_count = len(data[data['Global Rank'].apply(lambda x: isinstance(x, str) and x.startswith('#') and int(x.replace('#', '')) <= top_limit)])
732
+ else:
733
+ korean_count = len(data[data['Rank'].apply(lambda x: isinstance(x, (int, float)) and x <= top_limit)])
734
+ else:
735
+ korean_count = 0
736
+
737
+ other_count = total_count - korean_count
738
+
739
+ fig = go.Figure(data=[go.Pie(
740
+ labels=[f'Korean {type_name}', f'Other {type_name}'],
741
+ values=[korean_count, other_count], hole=.3,
742
+ marker_colors=['#FF6B6B', '#4ECDC4'],
743
+ textinfo='percent+value'
744
+ )])
745
+ fig.update_layout(
746
+ title=f"Korean vs Other {type_name} (Top {top_limit})",
747
+ showlegend=True, height=400, width=500,
748
+ paper_bgcolor='#e0e5ec'
749
+ )
750
+ return fig
751
+ except:
752
+ return go.Figure()
753
+
754
+ def refresh_all_data():
755
+ try:
756
+ spaces_results = get_spaces_data("trending")
757
+ models_results = get_models_data()
758
+
759
+ spaces_pie = create_pie_chart(spaces_results[2], 500, "Spaces")
760
+ spaces_bar = create_registration_bar_chart(spaces_results[2], "Spaces")
761
+ models_pie = create_pie_chart(models_results[2], 3000, "Models")
762
+ models_bar = create_registration_bar_chart(models_results[2], "Models")
763
+
764
+ return [spaces_results[0], spaces_results[1], spaces_results[2], spaces_pie, spaces_bar,
765
+ models_results[0], models_results[1], models_results[2], models_pie, models_bar]
766
+ except Exception as e:
767
+ print(f"Error: {str(e)}")
768
+ return [None] * 10
769
+
770
+ # Gradio ์•ฑ ์ •์˜
771
+ with gr.Blocks(css=CUSTOM_CSS, theme=gr.themes.Soft()) as demo:
772
+
773
+ gr.Markdown("""
774
+ # ๐Ÿค— ํ—ˆ๊น…ํŽ˜์ด์Šค 'ํ•œ๊ตญ(์–ธ์–ด) ๋ฆฌ๋”๋ณด๋“œ'
775
+ HuggingFace๊ฐ€ ์ œ๊ณตํ•˜๋Š” Spaces์™€ Models ์‹ค์‹œ๊ฐ„ ์ธ๊ธฐ ์ˆœ์œ„ ๋ฐ˜์˜ํ•˜์—ฌ 'ํ•œ๊ตญ์ธ(๊ธฐ์—…/์–ธ์–ด)'์˜ ๋ฆฌ์ŠคํŠธ(๊ณต๊ฐœ,๊ฒ€์ƒ‰,๋ฆฌ๋”๋ณด๋“œ ๋“ฑ)๋งŒ ๋ถ„์„.
776
+ (c)'ํ•œ๊ตญ์ธ๊ณต์ง€๋Šฅ์ง„ํฅํ˜‘ํšŒ' / ์š”์ฒญ: arxivgpt@gmail.com
777
+ """)
778
+
779
+ gr.Markdown("""
780
+ ### [Hot NEWS] ํ—ˆ๊น…ํŽ˜์ด์Šค ์„ ์ • 12์›” 'TOP 12'์— ํ•œ๊ตญ 'ginipick'์˜ 'FLUXllama'์™€ 'Text3D' 2์ข…์ด ์„ ์ •๋จ
781
+ """)
782
+
783
+ refresh_btn = gr.Button("๐Ÿ”„ ์ƒˆ๋กœ ๊ณ ์นจ", variant="primary", elem_classes=["neu-button"])
784
+
785
+ with gr.Tab("Spaces Trending"):
786
+ trending_plot = gr.Plot()
787
+ with gr.Row():
788
+ with gr.Column(scale=1):
789
+ spaces_pie_chart = gr.Plot(label="Korean Spaces Distribution", elem_id="spaces_pie")
790
+ with gr.Column(scale=2):
791
+ spaces_bar_chart = gr.Plot(label="Registrations by Creator", elem_id="spaces_bar")
792
+ trending_info = gr.HTML()
793
+ trending_df = gr.DataFrame(
794
+ headers=["Rank", "Space ID", "Title", "Likes", "URL"],
795
+ datatype=["number", "str", "str", "number", "str"],
796
+ row_count=(10, "dynamic")
797
+ )
798
+
799
+ with gr.Tab("Models Trending"):
800
+ models_plot = gr.Plot()
801
+ with gr.Row():
802
+ with gr.Column(scale=1):
803
+ models_pie_chart = gr.Plot(label="Korean Models Distribution", elem_id="models_pie")
804
+ with gr.Column(scale=2):
805
+ models_bar_chart = gr.Plot(label="Registrations by Creator", elem_id="models_bar")
806
+ models_info = gr.HTML()
807
+ models_df = gr.DataFrame(
808
+ headers=["Global Rank", "Model ID", "Title", "Downloads", "Likes", "Korea", "URL"],
809
+ datatype=["str", "str", "str", "str", "str", "str", "str"],
810
+ row_count=(10, "dynamic")
811
+ )
812
+
813
+ refresh_btn.click(
814
+ fn=refresh_all_data,
815
+ outputs=[
816
+ trending_plot, trending_info, trending_df, spaces_pie_chart, spaces_bar_chart,
817
+ models_plot, models_info, models_df, models_pie_chart, models_bar_chart
818
+ ]
819
+ )
820
+
821
+ # ์ดˆ๊ธฐ ๋ฐ์ดํ„ฐ ๋กœ๋“œ
822
+ try:
823
+ initial_data = refresh_all_data()
824
+ if initial_data[0]:
825
+ trending_plot.value = initial_data[0]
826
+ if initial_data[1]:
827
+ trending_info.value = initial_data[1]
828
+ if initial_data[2] is not None:
829
+ trending_df.value = initial_data[2]
830
+ if initial_data[3]:
831
+ spaces_pie_chart.value = initial_data[3]
832
+ if initial_data[4]:
833
+ spaces_bar_chart.value = initial_data[4]
834
+ if initial_data[5]:
835
+ models_plot.value = initial_data[5]
836
+ if initial_data[6]:
837
+ models_info.value = initial_data[6]
838
+ if initial_data[7] is not None:
839
+ models_df.value = initial_data[7]
840
+ if initial_data[8]:
841
+ models_pie_chart.value = initial_data[8]
842
+ if initial_data[9]:
843
+ models_bar_chart.value = initial_data[9]
844
+ except Exception as e:
845
+ print(f"Error loading initial data: {str(e)}")
846
+
847
+ demo.launch(server_name="0.0.0.0", server_port=7860, share=False, show_error=True)