Spaces:
Running
Running
Update app-backup-datasets.py
Browse files- app-backup-datasets.py +291 -293
app-backup-datasets.py
CHANGED
@@ -12,6 +12,8 @@ target_models = {
|
|
12 |
"seawolf2357/hanbok": "https://huggingface.co/seawolf2357/hanbok",
|
13 |
"seawolf2357/ntower": "https://huggingface.co/seawolf2357/ntower",
|
14 |
|
|
|
|
|
15 |
"LGAI-EXAONE/EXAONE-3.5-32B-Instruct": "https://huggingface.co/LGAI-EXAONE/EXAONE-3.5-32B-Instruct",
|
16 |
"LGAI-EXAONE/EXAONE-3.5-2.4B-Instruct": "https://huggingface.co/LGAI-EXAONE/EXAONE-3.5-2.4B-Instruct",
|
17 |
"LGAI-EXAONE/EXAONE-3.5-7.8B-Instruct": "https://huggingface.co/LGAI-EXAONE/EXAONE-3.5-7.8B-Instruct",
|
@@ -587,6 +589,68 @@ def get_models_data(progress=gr.Progress()):
|
|
587 |
|
588 |
# ๊ด์ฌ ์คํ์ด์ค URL ๋ฆฌ์คํธ์ ์ ๋ณด
|
589 |
target_spaces = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
590 |
"fantos/x-mas": "https://huggingface.co/spaces/fantos/x-mas",
|
591 |
"openfree/Korean-Leaderboard": "https://huggingface.co/spaces/openfree/Korean-Leaderboard",
|
592 |
"ginipick/FLUXllama": "https://huggingface.co/spaces/ginipick/FLUXllama",
|
@@ -617,24 +681,32 @@ target_spaces = {
|
|
617 |
"fantos/miro-game": "https://huggingface.co/spaces/fantos/miro-game",
|
618 |
"kolaslab/shooting": "https://huggingface.co/spaces/kolaslab/shooting",
|
619 |
"VIDraft/Mouse-Hackathon": "https://huggingface.co/spaces/VIDraft/Mouse-Hackathon",
|
620 |
-
"
|
621 |
-
"
|
622 |
-
|
623 |
-
"r3gm/DiffuseCraft": "https://huggingface.co/spaces/r3gm/DiffuseCraft",
|
624 |
-
|
625 |
-
"LeeSangHoon/HierSpeech_TTS": "https://huggingface.co/spaces/LeeSangHoon/HierSpeech_TTS",
|
626 |
-
"etri-vilab/KOALA": "https://huggingface.co/spaces/etri-vilab/KOALA",
|
627 |
-
"etri-vilab/Ko-LLaVA": "https://huggingface.co/spaces/etri-vilab/Ko-LLaVA",
|
628 |
-
|
629 |
"cutechicken/TankWar3D": "https://huggingface.co/spaces/cutechicken/TankWar3D",
|
630 |
"kolaslab/RC4-EnDecoder": "https://huggingface.co/spaces/kolaslab/RC4-EnDecoder",
|
631 |
"kolaslab/simulator": "https://huggingface.co/spaces/kolaslab/simulator",
|
632 |
"kolaslab/calculator": "https://huggingface.co/spaces/kolaslab/calculator",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
633 |
"etri-vilab/Ko-LLaVA": "https://huggingface.co/spaces/etri-vilab/Ko-LLaVA",
|
634 |
"etri-vilab/KOALA": "https://huggingface.co/spaces/etri-vilab/KOALA",
|
635 |
"naver-clova-ix/donut-base-finetuned-cord-v2": "https://huggingface.co/spaces/naver-clova-ix/donut-base-finetuned-cord-v2",
|
636 |
-
|
637 |
-
"NCSOFT/VARCO_Arena": "https://huggingface.co/spaces/NCSOFT/VARCO_Arena"
|
638 |
}
|
639 |
|
640 |
def get_spaces_data(sort_type="trending", progress=gr.Progress()):
|
@@ -991,330 +1063,256 @@ def refresh_data():
|
|
991 |
|
992 |
|
993 |
|
994 |
-
|
995 |
-
target_datasets = {
|
996 |
-
"aiqtech/kolaw": "https://huggingface.co/datasets/aiqtech/kolaw"
|
997 |
-
# ํ์ํ ๋ฐ์ดํฐ์
์ถ๊ฐ
|
998 |
-
}
|
999 |
-
|
1000 |
-
def get_korea_datasets():
|
1001 |
-
"""Korea ๊ด๋ จ ๋ฐ์ดํฐ์
๊ฒ์"""
|
1002 |
-
params = {
|
1003 |
-
"search": "korea",
|
1004 |
-
"full": "True",
|
1005 |
-
"limit": 10000
|
1006 |
-
}
|
1007 |
-
|
1008 |
try:
|
1009 |
-
|
1010 |
-
|
1011 |
-
headers={'Accept': 'application/json'}, # Authorization ๋์ Accept ํค๋ ์ฌ์ฉ
|
1012 |
-
params=params
|
1013 |
-
)
|
1014 |
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1019 |
else:
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
for offset in range(0, limit, page_size):
|
1032 |
-
params = {
|
1033 |
-
'limit': min(page_size, limit - offset),
|
1034 |
-
'full': 'True',
|
1035 |
-
'offset': offset
|
1036 |
-
}
|
1037 |
|
1038 |
-
|
1039 |
-
|
1040 |
-
headers={'Accept': 'application/json'}, # Authorization ๋์ Accept ํค๋ ์ฌ์ฉ
|
1041 |
-
params=params
|
1042 |
-
)
|
1043 |
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
# Korea ๊ฒ์ ๊ฒฐ๊ณผ๋ ๋์ผํ๊ฒ ํ์ฅ
|
1052 |
-
korea_params = {
|
1053 |
-
"search": "korea",
|
1054 |
-
"full": "True",
|
1055 |
-
"limit": limit
|
1056 |
-
}
|
1057 |
-
|
1058 |
-
korea_response = requests.get(
|
1059 |
-
"https://huggingface.co/api/datasets",
|
1060 |
-
headers={'Accept': 'application/json'}, # Authorization ๋์ Accept ํค๋ ์ฌ์ฉ
|
1061 |
-
params=korea_params
|
1062 |
-
)
|
1063 |
-
|
1064 |
-
if korea_response.status_code == 200:
|
1065 |
-
korea_datasets = korea_response.json()
|
1066 |
-
print(f"Fetched {len(korea_datasets)} Korea-related datasets")
|
1067 |
-
|
1068 |
-
# ์ค๋ณต ์ ๊ฑฐํ๋ฉด์ Korea ๋ฐ์ดํฐ์
์ถ๊ฐ
|
1069 |
-
existing_ids = {dataset.get('id', '') for dataset in all_datasets}
|
1070 |
-
for dataset in korea_datasets:
|
1071 |
-
if dataset.get('id', '') not in existing_ids:
|
1072 |
-
all_datasets.append(dataset)
|
1073 |
-
existing_ids.add(dataset.get('id', ''))
|
1074 |
-
|
1075 |
-
print(f"Total unique datasets: {len(all_datasets)}")
|
1076 |
-
return all_datasets[:limit]
|
1077 |
-
|
1078 |
-
def get_datasets_data(progress=gr.Progress()):
|
1079 |
-
def calculate_rank(dataset_id, all_global_datasets, korea_datasets):
|
1080 |
-
# ๊ธ๋ก๋ฒ ์์ ํ์ธ
|
1081 |
-
global_rank = next((idx for idx, d in enumerate(all_global_datasets, 1)
|
1082 |
-
if d.get('id', '').strip() == dataset_id.strip()), None)
|
1083 |
-
|
1084 |
-
# Korea ๋ฐ์ดํฐ์
์ธ ๊ฒฝ์ฐ
|
1085 |
-
is_korea = any(d.get('id', '').strip() == dataset_id.strip() for d in korea_datasets)
|
1086 |
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
|
|
1094 |
|
1095 |
-
return
|
|
|
|
|
|
|
1096 |
|
|
|
1097 |
try:
|
1098 |
-
|
1099 |
-
|
1100 |
-
if not HF_TOKEN:
|
1101 |
-
fig = create_error_plot()
|
1102 |
-
error_html = """
|
1103 |
-
<div style='padding: 20px; background: #fee; border-radius: 10px; margin: 10px 0;'>
|
1104 |
-
<h3 style='color: #c00;'>โ ๏ธ API ์ธ์ฆ์ด ํ์ํฉ๋๋ค</h3>
|
1105 |
-
<p>HuggingFace API ํ ํฐ์ด ์ค์ ๋์ง ์์์ต๋๋ค.</p>
|
1106 |
-
</div>
|
1107 |
-
"""
|
1108 |
-
empty_df = pd.DataFrame(columns=['Global Rank', 'Dataset ID', 'Title', 'Downloads', 'Likes', 'Korea Search', 'URL'])
|
1109 |
-
return fig, error_html, empty_df
|
1110 |
-
|
1111 |
-
# ์ผ๋ฐ ๋ฐ์ดํฐ์
๊ณผ Korea ๊ด๋ จ ๋ฐ์ดํฐ์
๋ชจ๋ ๊ฐ์ ธ์ค๊ธฐ
|
1112 |
-
all_global_datasets = get_all_datasets(limit=10000)
|
1113 |
-
korea_datasets = get_korea_datasets()
|
1114 |
|
1115 |
-
|
1116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1117 |
|
1118 |
-
|
1119 |
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
if response.status_code == 200:
|
1131 |
-
dataset_data = response.json()
|
1132 |
-
rank, is_korea = calculate_rank(dataset_id, all_global_datasets, korea_datasets)
|
1133 |
-
|
1134 |
-
filtered_datasets.append({
|
1135 |
-
'id': dataset_id,
|
1136 |
-
'global_rank': rank,
|
1137 |
-
'downloads': dataset_data.get('downloads', 0),
|
1138 |
-
'likes': dataset_data.get('likes', 0),
|
1139 |
-
'title': dataset_data.get('title', 'No Title'),
|
1140 |
-
'is_korea': is_korea
|
1141 |
-
})
|
1142 |
-
else:
|
1143 |
-
filtered_datasets.append({
|
1144 |
-
'id': dataset_id,
|
1145 |
-
'global_rank': 'Not in top 10000',
|
1146 |
-
'downloads': 0,
|
1147 |
-
'likes': 0,
|
1148 |
-
'title': 'No Title',
|
1149 |
-
'is_korea': False
|
1150 |
-
})
|
1151 |
-
except Exception as e:
|
1152 |
-
print(f"Error processing {dataset_id}: {str(e)}")
|
1153 |
-
continue
|
1154 |
-
|
1155 |
-
filtered_datasets.sort(key=lambda x: float('inf') if isinstance(x['global_rank'], str) else x['global_rank'])
|
1156 |
-
|
1157 |
-
# ์๊ฐํ ๋ฐ์ดํฐ ์ค๋น
|
1158 |
-
valid_datasets = [d for d in filtered_datasets if isinstance(d['global_rank'], (int, float))]
|
1159 |
|
1160 |
-
fig
|
|
|
|
|
|
|
|
|
|
|
1161 |
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
fig.add_trace(go.Bar(
|
1167 |
-
x=ids,
|
1168 |
-
y=[3001 - r for r in ranks],
|
1169 |
-
text=[f"Rank: #{r}<br>{'๐ฐ๐ท Korea Dataset<br>' if d['is_korea'] else ''}"
|
1170 |
-
f"Downloads: {format(d['downloads'], ',')}<br>"
|
1171 |
-
f"Likes: {format(d['likes'], ',')}"
|
1172 |
-
for r, d in zip(ranks, valid_datasets)],
|
1173 |
-
textposition='auto',
|
1174 |
-
marker_color=['rgba(255,0,0,0.6)' if d['is_korea'] else 'rgba(0,0,255,0.6)'
|
1175 |
-
for d in valid_datasets],
|
1176 |
-
opacity=0.8
|
1177 |
-
))
|
1178 |
-
|
1179 |
-
fig.update_layout(
|
1180 |
-
title="HuggingFace Datasets Global Rankings (Up to #3000)",
|
1181 |
-
xaxis_title="Dataset ID",
|
1182 |
-
yaxis_title="Global Rank",
|
1183 |
-
yaxis=dict(
|
1184 |
-
ticktext=[f"#{i}" for i in range(1, 10001, 100)],
|
1185 |
-
tickvals=[10001 - i for i in range(1, 10001, 100)],
|
1186 |
-
range=[0, 10000]
|
1187 |
-
),
|
1188 |
-
height=800,
|
1189 |
-
showlegend=False,
|
1190 |
-
template='plotly_white',
|
1191 |
-
xaxis_tickangle=-45
|
1192 |
-
)
|
1193 |
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
{f"border: 2px solid #e74c3c;" if dataset['is_korea'] else ""}
|
1213 |
-
'>
|
1214 |
-
<h3 style='color: #34495e;'>{rank_display}</h3>
|
1215 |
-
<h4 style='color: #2c3e50;'>{dataset['id']}</h4>
|
1216 |
-
<p style='color: #e74c3c; font-weight: bold;'>{korea_badge}</p>
|
1217 |
-
<p style='color: #7f8c8d;'>โฌ๏ธ Downloads: {format(dataset['downloads'], ',')}</p>
|
1218 |
-
<p style='color: #7f8c8d;'>๐ Likes: {format(dataset['likes'], ',')}</p>
|
1219 |
-
<a href='{target_datasets[dataset['id']]}'
|
1220 |
-
target='_blank'
|
1221 |
-
style='
|
1222 |
-
display: inline-block;
|
1223 |
-
padding: 8px 16px;
|
1224 |
-
background: #3498db;
|
1225 |
-
color: white;
|
1226 |
-
text-decoration: none;
|
1227 |
-
border-radius: 5px;
|
1228 |
-
transition: background 0.3s;
|
1229 |
-
'>
|
1230 |
-
Visit Dataset ๐
|
1231 |
-
</a>
|
1232 |
-
</div>
|
1233 |
-
"""
|
1234 |
-
|
1235 |
-
html_content += "</div></div>"
|
1236 |
-
|
1237 |
-
# ๋ฐ์ดํฐํ๋ ์ ์์ฑ
|
1238 |
-
df = pd.DataFrame([{
|
1239 |
-
'Global Rank': f"#{d['global_rank']}" if isinstance(d['global_rank'], (int, float)) else d['global_rank'],
|
1240 |
-
'Dataset ID': d['id'],
|
1241 |
-
'Title': d['title'],
|
1242 |
-
'Downloads': format(d['downloads'], ','),
|
1243 |
-
'Likes': format(d['likes'], ','),
|
1244 |
-
'Korea Search': '๐ฐ๐ท' if d['is_korea'] else '',
|
1245 |
-
'URL': target_datasets[d['id']]
|
1246 |
-
} for d in filtered_datasets])
|
1247 |
-
|
1248 |
-
progress(1.0, desc="Complete!")
|
1249 |
-
return fig, html_content, df
|
1250 |
|
1251 |
-
except Exception as e:
|
1252 |
-
print(f"Error in get_datasets_data: {str(e)}")
|
1253 |
-
error_fig = create_error_plot()
|
1254 |
-
error_html = f"""
|
1255 |
-
<div style='padding: 20px; background: #fee; border-radius: 10px; margin: 10px 0;'>
|
1256 |
-
<h3 style='color: #c00;'>โ ๏ธ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค</h3>
|
1257 |
-
<p>{str(e)}</p>
|
1258 |
-
</div>
|
1259 |
-
"""
|
1260 |
-
empty_df = pd.DataFrame(columns=['Global Rank', 'Dataset ID', 'Title', 'Downloads', 'Likes', 'Korea Search', 'URL'])
|
1261 |
-
return error_fig, error_html, empty_df
|
1262 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1263 |
|
1264 |
-
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
1265 |
gr.Markdown("""
|
1266 |
# ๐ค ํ๊น
ํ์ด์ค 'ํ๊ตญ(์ธ์ด) ๋ฆฌ๋๋ณด๋'
|
1267 |
-
HuggingFace๊ฐ ์ ๊ณตํ๋ Spaces
|
|
|
|
|
|
|
|
|
|
|
1268 |
""")
|
|
|
1269 |
|
|
|
1270 |
refresh_btn = gr.Button("๐ ์๋ก ๊ณ ์นจ", variant="primary")
|
1271 |
|
|
|
1272 |
with gr.Tab("Spaces Trending"):
|
1273 |
trending_plot = gr.Plot()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1274 |
trending_info = gr.HTML()
|
1275 |
-
trending_df = gr.DataFrame(
|
1276 |
-
|
|
|
|
|
|
|
|
|
1277 |
with gr.Tab("Models Trending"):
|
1278 |
models_plot = gr.Plot()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1279 |
models_info = gr.HTML()
|
1280 |
-
models_df = gr.DataFrame(
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
def refresh_all_data():
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1297 |
refresh_btn.click(
|
1298 |
-
refresh_all_data,
|
1299 |
outputs=[
|
1300 |
trending_plot, trending_info, trending_df,
|
|
|
1301 |
models_plot, models_info, models_df,
|
1302 |
-
|
1303 |
]
|
1304 |
)
|
1305 |
|
1306 |
# ์ด๊ธฐ ๋ฐ์ดํฐ ๋ก๋
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1314 |
|
1315 |
# Gradio ์ฑ ์คํ
|
1316 |
demo.launch(
|
1317 |
server_name="0.0.0.0",
|
1318 |
server_port=7860,
|
1319 |
-
share=False
|
|
|
1320 |
)
|
|
|
12 |
"seawolf2357/hanbok": "https://huggingface.co/seawolf2357/hanbok",
|
13 |
"seawolf2357/ntower": "https://huggingface.co/seawolf2357/ntower",
|
14 |
|
15 |
+
"openfree/claude-monet": "https://huggingface.co/openfree/claude-monet",
|
16 |
+
|
17 |
"LGAI-EXAONE/EXAONE-3.5-32B-Instruct": "https://huggingface.co/LGAI-EXAONE/EXAONE-3.5-32B-Instruct",
|
18 |
"LGAI-EXAONE/EXAONE-3.5-2.4B-Instruct": "https://huggingface.co/LGAI-EXAONE/EXAONE-3.5-2.4B-Instruct",
|
19 |
"LGAI-EXAONE/EXAONE-3.5-7.8B-Instruct": "https://huggingface.co/LGAI-EXAONE/EXAONE-3.5-7.8B-Instruct",
|
|
|
589 |
|
590 |
# ๊ด์ฌ ์คํ์ด์ค URL ๋ฆฌ์คํธ์ ์ ๋ณด
|
591 |
target_spaces = {
|
592 |
+
|
593 |
+
"kolaslab/Quantum"": "https://huggingface.co/spaces/kolaslab/Quantum",
|
594 |
+
"openfree/webtoon": "https://huggingface.co/spaces/openfree/webtoon",
|
595 |
+
"immunobiotech/ChicagoGallery": "https://huggingface.co/spaces/immunobiotech/ChicagoGallery",
|
596 |
+
"immunobiotech/MetropolitanMuseum": "https://huggingface.co/spaces/immunobiotech/MetropolitanMuseum",
|
597 |
+
"immunobiotech/opensky": "https://huggingface.co/spaces/immunobiotech/opensky",
|
598 |
+
|
599 |
+
"kolaslab/Audio-Visualizer": "https://huggingface.co/spaces/kolaslab/Audio-Visualizer",
|
600 |
+
"kolaslab/Radio-Learning": "https://huggingface.co/spaces/kolaslab/Radio-Learning",
|
601 |
+
"kolaslab/Future-Gallaxy": "https://huggingface.co/spaces/kolaslab/Future-Gallaxy",
|
602 |
+
"openfree/ProteinGenesis": "https://huggingface.co/spaces/openfree/ProteinGenesis",
|
603 |
+
"openfree/2025saju": "https://huggingface.co/spaces/openfree/2025saju",
|
604 |
+
"ginigen/Dokdo-membership": "https://huggingface.co/spaces/ginigen/Dokdo-membership",
|
605 |
+
"VIDraft/eum": "https://huggingface.co/spaces/VIDraft/eum",
|
606 |
+
"kolaslab/VisionART": "https://huggingface.co/spaces/kolaslab/VisionART",
|
607 |
+
"aiqtech/FLUX-military": "https://huggingface.co/spaces/aiqtech/FLUX-military",
|
608 |
+
"fantaxy/Rolls-Royce": "https://huggingface.co/spaces/fantaxy/Rolls-Royce",
|
609 |
+
"seawolf2357/flux-korea-hanbok-lora": "https://huggingface.co/spaces/seawolf2357/flux-korea-hanbok-lora",
|
610 |
+
"seawolf2357/flux-korea-palace-lora": "https://huggingface.co/spaces/seawolf2357/flux-korea-palace-lora",
|
611 |
+
"aiqcamp/flux-cat-lora": "https://huggingface.co/spaces/aiqcamp/flux-cat-lora",
|
612 |
+
"gunship999/SexyImages": "https://huggingface.co/spaces/gunship999/SexyImages",
|
613 |
+
"aiqtech/flux-claude-monet-lora": "https://huggingface.co/spaces/aiqtech/flux-claude-monet-lora",
|
614 |
+
"ginigen/CANVAS-o3": "https://huggingface.co/spaces/ginigen/CANVAS-o3",
|
615 |
+
"kolaslab/world-sdr": "https://huggingface.co/spaces/kolaslab/world-sdr",
|
616 |
+
"seawolf2357/3D-Avatar-Generator": "https://huggingface.co/spaces/seawolf2357/3D-Avatar-Generator",
|
617 |
+
"fantaxy/playground25": "https://huggingface.co/spaces/fantaxy/playground25",
|
618 |
+
"openfree/ultpixgen": "https://huggingface.co/spaces/openfree/ultpixgen",
|
619 |
+
"kolaslab/VISION-NIGHT": "https://huggingface.co/spaces/kolaslab/VISION-NIGHT",
|
620 |
+
"kolaslab/FLUX-WEB": "https://huggingface.co/spaces/kolaslab/FLUX-WEB",
|
621 |
+
"seawolf2357/REALVISXL-V5": "https://huggingface.co/spaces/seawolf2357/REALVISXL-V5",
|
622 |
+
"ginipick/Dokdo-multimodal": "https://huggingface.co/spaces/ginipick/Dokdo-multimodal",
|
623 |
+
"ginigen/theater": "https://huggingface.co/spaces/ginigen/theater",
|
624 |
+
"VIDraft/stock": "https://huggingface.co/spaces/VIDraft/stock",
|
625 |
+
"fantos/flxcontrol": "https://huggingface.co/spaces/fantos/flxcontrol",
|
626 |
+
"fantos/textcutobject": "https://huggingface.co/spaces/fantos/textcutobject",
|
627 |
+
"ginipick/FLUX-Prompt-Generator": "https://huggingface.co/spaces/ginipick/FLUX-Prompt-Generator",
|
628 |
+
"fantaxy/flxloraexp": "https://huggingface.co/spaces/fantaxy/flxloraexp",
|
629 |
+
"fantos/flxloraexp": "https://huggingface.co/spaces/fantos/flxloraexp",
|
630 |
+
"seawolf2357/flxloraexp": "https://huggingface.co/spaces/seawolf2357/flxloraexp",
|
631 |
+
"ginipick/flxloraexp": "https://huggingface.co/spaces/ginipick/flxloraexp",
|
632 |
+
"ginipick/FLUX-Prompt-Generator": "https://huggingface.co/spaces/ginipick/FLUX-Prompt-Generator",
|
633 |
+
"ginigen/Dokdo": "https://huggingface.co/spaces/ginigen/Dokdo",
|
634 |
+
"aiqcamp/imagemagic": "https://huggingface.co/spaces/aiqcamp/imagemagic",
|
635 |
+
"openfree/ColorRevive": "https://huggingface.co/spaces/openfree/ColorRevive",
|
636 |
+
"VIDraft/RAGOndevice": "https://huggingface.co/spaces/VIDraft/RAGOndevice",
|
637 |
+
"gunship999/Radar-Bluetooth": "https://huggingface.co/spaces/gunship999/Radar-Bluetooth",
|
638 |
+
"gunship999/WiFi-VISION": "https://huggingface.co/spaces/gunship999/WiFi-VISION",
|
639 |
+
"gunship999/SONAR-Radar": "https://huggingface.co/spaces/gunship999/SONAR-Radar",
|
640 |
+
"aiqcamp/AudioLlama": "https://huggingface.co/spaces/aiqcamp/AudioLlama",
|
641 |
+
"ginigen/FLUXllama-Multilingual": "https://huggingface.co/spaces/ginigen/FLUXllama-Multilingual",
|
642 |
+
"ginipick/ginimedi": "https://huggingface.co/spaces/ginipick/ginimedi",
|
643 |
+
"ginipick/ginilaw": "https://huggingface.co/spaces/ginipick/ginilaw",
|
644 |
+
"ginipick/ginipharm": "https://huggingface.co/spaces/ginipick/ginipharm",
|
645 |
+
"ginipick/FitGen": "https://huggingface.co/spaces/ginipick/FitGen",
|
646 |
+
"fantaxy/FLUX-Animations": "https://huggingface.co/spaces/fantaxy/FLUX-Animations",
|
647 |
+
"fantaxy/Remove-Video-Background": "https://huggingface.co/spaces/fantaxy/Remove-Video-Background",
|
648 |
+
"fantaxy/ofai-flx-logo": "https://huggingface.co/spaces/fantaxy/ofai-flx-logo",
|
649 |
+
"fantaxy/flx-pulid": "https://huggingface.co/spaces/fantaxy/flx-pulid",
|
650 |
+
"fantaxy/flx-upscale": "https://huggingface.co/spaces/fantaxy/flx-upscale",
|
651 |
+
"aiqcamp/Fashion-FLUX": "https://huggingface.co/spaces/aiqcamp/Fashion-FLUX",
|
652 |
+
"ginipick/StyleGen": "https://huggingface.co/spaces/ginipick/StyleGen",
|
653 |
+
"openfree/StoryStar": "https://huggingface.co/spaces/openfree/StoryStar",
|
654 |
"fantos/x-mas": "https://huggingface.co/spaces/fantos/x-mas",
|
655 |
"openfree/Korean-Leaderboard": "https://huggingface.co/spaces/openfree/Korean-Leaderboard",
|
656 |
"ginipick/FLUXllama": "https://huggingface.co/spaces/ginipick/FLUXllama",
|
|
|
681 |
"fantos/miro-game": "https://huggingface.co/spaces/fantos/miro-game",
|
682 |
"kolaslab/shooting": "https://huggingface.co/spaces/kolaslab/shooting",
|
683 |
"VIDraft/Mouse-Hackathon": "https://huggingface.co/spaces/VIDraft/Mouse-Hackathon",
|
684 |
+
"aiqmaster/stocksimulation": "https://huggingface.co/spaces/aiqmaster/stocksimulation",
|
685 |
+
"aiqmaster/assetai": "https://huggingface.co/spaces/aiqmaster/assetai",
|
686 |
+
"aiqmaster/stockai": "https://huggingface.co/spaces/aiqmaster/stockai",
|
|
|
|
|
|
|
|
|
|
|
|
|
687 |
"cutechicken/TankWar3D": "https://huggingface.co/spaces/cutechicken/TankWar3D",
|
688 |
"kolaslab/RC4-EnDecoder": "https://huggingface.co/spaces/kolaslab/RC4-EnDecoder",
|
689 |
"kolaslab/simulator": "https://huggingface.co/spaces/kolaslab/simulator",
|
690 |
"kolaslab/calculator": "https://huggingface.co/spaces/kolaslab/calculator",
|
691 |
+
"aiqtech/kofaceid": "https://huggingface.co/spaces/aiqtech/kofaceid",
|
692 |
+
"fantaxy/fastvideogena": "https://huggingface.co/spaces/fantaxy/fastvideogen",
|
693 |
+
"fantos/cogvidx": "https://huggingface.co/spaces/fantos/cogvidx",
|
694 |
+
"fantos/flxfashmodel": "https://huggingface.co/spaces/fantos/flxfashmodel",
|
695 |
+
"fantos/kolcontrl": "https://huggingface.co/spaces/fantos/kolcontrl",
|
696 |
+
"fantos/EveryText": "https://huggingface.co/spaces/fantos/EveryText",
|
697 |
+
"aiqtech/cinevid": "https://huggingface.co/spaces/aiqtech/cinevid",
|
698 |
+
"aiqtech/FLUX-Ghibli-Studio-LoRA": "https://huggingface.co/spaces/aiqtech/FLUX-Ghibli-Studio-LoRA",
|
699 |
+
"aiqtech/flxgif": "https://huggingface.co/spaces/aiqtech/flxgif",
|
700 |
+
"aiqtech/imaginpaint": "https://huggingface.co/spaces/aiqtech/imaginpaint",
|
701 |
+
|
702 |
+
|
703 |
+
"upstage/open-ko-llm-leaderboard": "https://huggingface.co/spaces/upstage/open-ko-llm-leaderboard",
|
704 |
+
"LGAI-EXAONE/EXAONE-3.5-Instruct-Demo": "https://huggingface.co/spaces/LGAI-EXAONE/EXAONE-3.5-Instruct-Demo",
|
705 |
+
"LeeSangHoon/HierSpeech_TTS": "https://huggingface.co/spaces/LeeSangHoon/HierSpeech_TTS",
|
706 |
"etri-vilab/Ko-LLaVA": "https://huggingface.co/spaces/etri-vilab/Ko-LLaVA",
|
707 |
"etri-vilab/KOALA": "https://huggingface.co/spaces/etri-vilab/KOALA",
|
708 |
"naver-clova-ix/donut-base-finetuned-cord-v2": "https://huggingface.co/spaces/naver-clova-ix/donut-base-finetuned-cord-v2",
|
709 |
+
"NCSOFT/VARCO_Arena": "https://huggingface.co/spaces/NCSOFT/VARCO_Arena"
|
|
|
710 |
}
|
711 |
|
712 |
def get_spaces_data(sort_type="trending", progress=gr.Progress()):
|
|
|
1063 |
|
1064 |
|
1065 |
|
1066 |
+
def create_registration_bar_chart(data, type_name="Spaces"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1067 |
try:
|
1068 |
+
# TOP ๊ธฐ์ค ์ค์
|
1069 |
+
top_limit = 500 if type_name == "Spaces" else 3000
|
|
|
|
|
|
|
1070 |
|
1071 |
+
# DataFrame์ธ ๊ฒฝ์ฐ ์ฒ๋ฆฌ
|
1072 |
+
if isinstance(data, pd.DataFrame):
|
1073 |
+
if type_name == "Models":
|
1074 |
+
# 3000์ ์ด๋ด์ ๋ชจ๋ธ๋ง ํํฐ๋ง
|
1075 |
+
data = data[data['Global Rank'].apply(lambda x: isinstance(x, (int, float)) or (isinstance(x, str) and x.startswith('#')))]
|
1076 |
+
data = data[data['Global Rank'].apply(lambda x: int(str(x).replace('#', '')) if isinstance(x, str) else x) <= top_limit]
|
1077 |
+
elif type_name == "Spaces":
|
1078 |
+
# 500์ ์ด๋ด์ ์คํ์ด์ค๋ง ํํฐ๋ง
|
1079 |
+
data = data[data['Rank'].apply(lambda x: isinstance(x, (int, float))) & (data['Rank'] <= top_limit)]
|
1080 |
+
|
1081 |
+
# ID ์ปฌ๋ผ ์ ํ
|
1082 |
+
id_column = 'Space ID' if type_name == "Spaces" else 'Model ID'
|
1083 |
+
registrations = data[id_column].apply(lambda x: x.split('/')[0]).value_counts()
|
1084 |
else:
|
1085 |
+
# ๋ฆฌ์คํธ๋ ๋ค๋ฅธ ํํ์ ๋ฐ์ดํฐ์ธ ๊ฒฝ์ฐ ์ฒ๋ฆฌ
|
1086 |
+
registrations = {}
|
1087 |
+
for item in data:
|
1088 |
+
if isinstance(item, dict):
|
1089 |
+
rank = item.get('global_rank' if type_name == "Models" else 'rank')
|
1090 |
+
if isinstance(rank, str) or rank > top_limit:
|
1091 |
+
continue
|
1092 |
+
creator = item.get('id', '').split('/')[0]
|
1093 |
+
registrations[creator] = registrations.get(creator, 0) + 1
|
1094 |
+
registrations = pd.Series(registrations)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1095 |
|
1096 |
+
# ์ ๋ ฌ๋ ๋ฐ์ดํฐ ์ค๋น
|
1097 |
+
registrations = registrations.sort_values(ascending=False)
|
|
|
|
|
|
|
1098 |
|
1099 |
+
fig = go.Figure(data=[go.Bar(
|
1100 |
+
x=registrations.index,
|
1101 |
+
y=registrations.values,
|
1102 |
+
text=registrations.values,
|
1103 |
+
textposition='auto',
|
1104 |
+
marker_color='#FF6B6B'
|
1105 |
+
)])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1106 |
|
1107 |
+
fig.update_layout(
|
1108 |
+
title=f"Korean {type_name} Registrations by Creator (Top {top_limit})",
|
1109 |
+
xaxis_title="Creator ID",
|
1110 |
+
yaxis_title="Number of Registrations",
|
1111 |
+
showlegend=False,
|
1112 |
+
height=400,
|
1113 |
+
width=700
|
1114 |
+
)
|
1115 |
|
1116 |
+
return fig
|
1117 |
+
except Exception as e:
|
1118 |
+
print(f"Error in create_registration_bar_chart: {str(e)}")
|
1119 |
+
return go.Figure()
|
1120 |
|
1121 |
+
def create_pie_chart(data, total_count, type_name="Spaces"):
|
1122 |
try:
|
1123 |
+
# TOP ๊ธฐ์ค ์ค์
|
1124 |
+
top_limit = 500 if type_name == "Spaces" else 3000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1125 |
|
1126 |
+
# DataFrame์ธ ๊ฒฝ์ฐ ์ฒ๋ฆฌ
|
1127 |
+
if isinstance(data, pd.DataFrame):
|
1128 |
+
if type_name == "Models":
|
1129 |
+
# 3000์ ์ด๋ด์ ๋ชจ๋ธ๋ง ํํฐ๋ง
|
1130 |
+
data = data[data['Global Rank'].apply(lambda x: isinstance(x, (int, float)) or (isinstance(x, str) and x.startswith('#')))]
|
1131 |
+
data = data[data['Global Rank'].apply(lambda x: int(str(x).replace('#', '')) if isinstance(x, str) else x) <= top_limit]
|
1132 |
+
elif type_name == "Spaces":
|
1133 |
+
# 500์ ์ด๋ด์ ์คํ์ด์ค๋ง ํํฐ๋ง
|
1134 |
+
data = data[data['Rank'].apply(lambda x: isinstance(x, (int, float))) & (data['Rank'] <= top_limit)]
|
1135 |
+
korean_count = len(data)
|
1136 |
+
else:
|
1137 |
+
# ๋ฆฌ์คํธ๋ ๋ค๋ฅธ ํํ์ ๋ฐ์ดํฐ์ธ ๊ฒฝ์ฐ ์ฒ๋ฆฌ
|
1138 |
+
if type_name == "Models":
|
1139 |
+
korean_count = sum(1 for item in data if isinstance(item.get('global_rank'), (int, float)) and item.get('global_rank') <= top_limit)
|
1140 |
+
else:
|
1141 |
+
korean_count = sum(1 for item in data if isinstance(item.get('rank'), (int, float)) and item.get('rank') <= top_limit)
|
1142 |
|
1143 |
+
other_count = total_count - korean_count
|
1144 |
|
1145 |
+
fig = go.Figure(data=[go.Pie(
|
1146 |
+
labels=[f'Korean {type_name} in Top {top_limit}', f'Other {type_name} in Top {top_limit}'],
|
1147 |
+
values=[korean_count, other_count],
|
1148 |
+
hole=.3,
|
1149 |
+
marker_colors=['#FF6B6B', '#4ECDC4'],
|
1150 |
+
textinfo='percent+value',
|
1151 |
+
hovertemplate="<b>%{label}</b><br>" +
|
1152 |
+
"Count: %{value}<br>" +
|
1153 |
+
"Percentage: %{percent}<br>"
|
1154 |
+
)])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1155 |
|
1156 |
+
fig.update_layout(
|
1157 |
+
title=f"Korean vs Other {type_name} Distribution (Top {top_limit})",
|
1158 |
+
showlegend=True,
|
1159 |
+
height=400,
|
1160 |
+
width=500
|
1161 |
+
)
|
1162 |
|
1163 |
+
return fig
|
1164 |
+
except Exception as e:
|
1165 |
+
print(f"Error in create_pie_chart: {str(e)}")
|
1166 |
+
return go.Figure()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1167 |
|
1168 |
+
def refresh_all_data():
|
1169 |
+
spaces_results = get_spaces_data("trending")
|
1170 |
+
models_results = get_models_data()
|
1171 |
+
|
1172 |
+
# Spaces ์ฐจํธ ์์ฑ
|
1173 |
+
spaces_pie = create_pie_chart(spaces_results[2], 500, "Spaces")
|
1174 |
+
spaces_bar = create_registration_bar_chart(spaces_results[2], "Spaces")
|
1175 |
+
|
1176 |
+
# Models ์ฐจํธ ์์ฑ
|
1177 |
+
models_pie = create_pie_chart(models_results[2], 3000, "Models")
|
1178 |
+
models_bar = create_registration_bar_chart(models_results[2], "Models")
|
1179 |
+
|
1180 |
+
return [
|
1181 |
+
spaces_results[0], spaces_results[1], spaces_results[2],
|
1182 |
+
spaces_pie, spaces_bar,
|
1183 |
+
models_results[0], models_results[1], models_results[2],
|
1184 |
+
models_pie, models_bar
|
1185 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1187 |
|
1188 |
+
with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css="""
|
1189 |
+
#spaces_pie, #models_pie {
|
1190 |
+
min-height: 400px;
|
1191 |
+
border-radius: 10px;
|
1192 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
1193 |
+
}
|
1194 |
+
#spaces_bar, #models_bar {
|
1195 |
+
min-height: 400px;
|
1196 |
+
border-radius: 10px;
|
1197 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
1198 |
+
}
|
1199 |
+
""") as demo:
|
1200 |
|
|
|
1201 |
gr.Markdown("""
|
1202 |
# ๐ค ํ๊น
ํ์ด์ค 'ํ๊ตญ(์ธ์ด) ๋ฆฌ๋๋ณด๋'
|
1203 |
+
HuggingFace๊ฐ ์ ๊ณตํ๋ Spaces์ Models ์ค์๊ฐ ์ธ๊ธฐ ์์ ๋ฐ์ํ์ฌ 'ํ๊ตญ์ธ(๊ธฐ์
/์ธ์ด)'์ ๋ฆฌ์คํธ(๊ณต๊ฐ,๊ฒ์,๋ฆฌ๋๋ณด๋ ๋ฑ)๋ง ๋ถ์. (c)'ํ๊ตญ์ธ๊ณต์ง๋ฅ์งํฅํํ' / ์์ฒญ: [email protected]
|
1204 |
+
""")
|
1205 |
+
|
1206 |
+
# ์ด๋ฏธ์ง์ ์ค๋ช
์ถ๊ฐ
|
1207 |
+
gr.Markdown("""
|
1208 |
+
### [Hot NEWS] ํ๊น
ํ์ด์ค ์ ์ 12์ 'TOP 12'์ ํ๊ตญ 'ginipick'์ 'FLUXllama'์ 'Text3D' 2์ข
์ด ์ ์ ๋จ
|
1209 |
""")
|
1210 |
+
gr.Image("HF-TOP12.png", show_label=False)
|
1211 |
|
1212 |
+
# ์๋ก ๊ณ ์นจ ๋ฒํผ (๊ธฐ์กด ์ฝ๋)
|
1213 |
refresh_btn = gr.Button("๐ ์๋ก ๊ณ ์นจ", variant="primary")
|
1214 |
|
1215 |
+
|
1216 |
with gr.Tab("Spaces Trending"):
|
1217 |
trending_plot = gr.Plot()
|
1218 |
+
with gr.Row():
|
1219 |
+
# ์ํ ๊ทธ๋ํ์ ๋ง๋ ๊ทธ๋ํ๋ฅผ ์ํ ์ปจํ
์ด๋ ์ถ๊ฐ
|
1220 |
+
with gr.Column(scale=1):
|
1221 |
+
spaces_pie_chart = gr.Plot(
|
1222 |
+
label="Korean Spaces Distribution",
|
1223 |
+
elem_id="spaces_pie"
|
1224 |
+
)
|
1225 |
+
with gr.Column(scale=2):
|
1226 |
+
spaces_bar_chart = gr.Plot(
|
1227 |
+
label="Registrations by Creator",
|
1228 |
+
elem_id="spaces_bar"
|
1229 |
+
)
|
1230 |
trending_info = gr.HTML()
|
1231 |
+
trending_df = gr.DataFrame(
|
1232 |
+
headers=["Rank", "Space ID", "Title", "Likes", "URL"],
|
1233 |
+
datatype=["number", "str", "str", "number", "str"],
|
1234 |
+
row_count=(10, "dynamic")
|
1235 |
+
)
|
1236 |
+
|
1237 |
with gr.Tab("Models Trending"):
|
1238 |
models_plot = gr.Plot()
|
1239 |
+
with gr.Row():
|
1240 |
+
# ์ํ ๊ทธ๋ํ์ ๋ง๋ ๊ทธ๋ํ๋ฅผ ์ํ ์ปจํ
์ด๋ ์ถ๊ฐ
|
1241 |
+
with gr.Column(scale=1):
|
1242 |
+
models_pie_chart = gr.Plot(
|
1243 |
+
label="Korean Models Distribution",
|
1244 |
+
elem_id="models_pie"
|
1245 |
+
)
|
1246 |
+
with gr.Column(scale=2):
|
1247 |
+
models_bar_chart = gr.Plot(
|
1248 |
+
label="Registrations by Creator",
|
1249 |
+
elem_id="models_bar"
|
1250 |
+
)
|
1251 |
models_info = gr.HTML()
|
1252 |
+
models_df = gr.DataFrame(
|
1253 |
+
headers=["Global Rank", "Model ID", "Title", "Downloads", "Likes", "Korea Search", "URL"],
|
1254 |
+
datatype=["str", "str", "str", "str", "str", "str", "str"],
|
1255 |
+
row_count=(10, "dynamic")
|
1256 |
+
)
|
1257 |
+
|
|
|
1258 |
def refresh_all_data():
|
1259 |
+
try:
|
1260 |
+
spaces_results = get_spaces_data("trending")
|
1261 |
+
models_results = get_models_data()
|
1262 |
+
|
1263 |
+
# Spaces ์ฐจํธ ์์ฑ
|
1264 |
+
spaces_pie = create_pie_chart(spaces_results[2], 500, "Spaces")
|
1265 |
+
spaces_bar = create_registration_bar_chart(spaces_results[2], "Spaces")
|
1266 |
+
|
1267 |
+
# Models ์ฐจํธ ์์ฑ
|
1268 |
+
models_pie = create_pie_chart(models_results[2], 3000, "Models")
|
1269 |
+
models_bar = create_registration_bar_chart(models_results[2], "Models")
|
1270 |
+
|
1271 |
+
return [
|
1272 |
+
spaces_results[0], spaces_results[1], spaces_results[2],
|
1273 |
+
spaces_pie, spaces_bar,
|
1274 |
+
models_results[0], models_results[1], models_results[2],
|
1275 |
+
models_pie, models_bar
|
1276 |
+
]
|
1277 |
+
except Exception as e:
|
1278 |
+
print(f"Error in refresh_all_data: {str(e)}")
|
1279 |
+
# ์๋ฌ ๋ฐ์ ์ ๊ธฐ๋ณธ๊ฐ ๋ฐํ
|
1280 |
+
return [None] * 10
|
1281 |
+
|
1282 |
+
# ์๋ก๊ณ ์นจ ๋ฒํผ ํด๋ฆญ ์ด๋ฒคํธ ํธ๋ค๋ฌ
|
1283 |
refresh_btn.click(
|
1284 |
+
fn=refresh_all_data,
|
1285 |
outputs=[
|
1286 |
trending_plot, trending_info, trending_df,
|
1287 |
+
spaces_pie_chart, spaces_bar_chart,
|
1288 |
models_plot, models_info, models_df,
|
1289 |
+
models_pie_chart, models_bar_chart
|
1290 |
]
|
1291 |
)
|
1292 |
|
1293 |
# ์ด๊ธฐ ๋ฐ์ดํฐ ๋ก๋
|
1294 |
+
try:
|
1295 |
+
initial_data = refresh_all_data()
|
1296 |
+
|
1297 |
+
# ์ด๊ธฐ๊ฐ ์ค์
|
1298 |
+
trending_plot.value = initial_data[0]
|
1299 |
+
trending_info.value = initial_data[1]
|
1300 |
+
trending_df.value = initial_data[2]
|
1301 |
+
spaces_pie_chart.value = initial_data[3]
|
1302 |
+
spaces_bar_chart.value = initial_data[4]
|
1303 |
+
models_plot.value = initial_data[5]
|
1304 |
+
models_info.value = initial_data[6]
|
1305 |
+
models_df.value = initial_data[7]
|
1306 |
+
models_pie_chart.value = initial_data[8]
|
1307 |
+
models_bar_chart.value = initial_data[9]
|
1308 |
+
except Exception as e:
|
1309 |
+
print(f"Error loading initial data: {str(e)}")
|
1310 |
+
gr.Warning("์ด๊ธฐ ๋ฐ์ดํฐ ๋ก๋ ์ค ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.")
|
1311 |
|
1312 |
# Gradio ์ฑ ์คํ
|
1313 |
demo.launch(
|
1314 |
server_name="0.0.0.0",
|
1315 |
server_port=7860,
|
1316 |
+
share=False,
|
1317 |
+
show_error=True
|
1318 |
)
|