openfree commited on
Commit
119ab57
ยท
verified ยท
1 Parent(s): f527774

Update app-backup-datasets.py

Browse files
Files changed (1) hide show
  1. 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
- "upstage/open-ko-llm-leaderboard": "https://huggingface.co/spaces/upstage/open-ko-llm-leaderboard",
621
- "LGAI-EXAONE/EXAONE-3.5-Instruct-Demo": "https://huggingface.co/spaces/LGAI-EXAONE/EXAONE-3.5-Instruct-Demo",
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
- response = requests.get(
1010
- "https://huggingface.co/api/datasets",
1011
- headers={'Accept': 'application/json'}, # Authorization ๋Œ€์‹  Accept ํ—ค๋” ์‚ฌ์šฉ
1012
- params=params
1013
- )
1014
 
1015
- if response.status_code == 200:
1016
- korea_datasets = response.json()
1017
- print(f"Found {len(korea_datasets)} Korea-related datasets")
1018
- return korea_datasets
 
 
 
 
 
 
 
 
 
1019
  else:
1020
- print(f"Failed to fetch Korea datasets: {response.status_code}")
1021
- return []
1022
- except Exception as e:
1023
- print(f"Error fetching Korea datasets: {str(e)}")
1024
- return []
1025
-
1026
- def get_all_datasets(limit=10000):
1027
- """๋ชจ๋“  ๋ฐ์ดํ„ฐ์…‹๊ณผ Korea ๊ด€๋ จ ๋ฐ์ดํ„ฐ์…‹ ๊ฐ€์ ธ์˜ค๊ธฐ"""
1028
- all_datasets = []
1029
- page_size = 1000
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
- response = requests.get(
1039
- "https://huggingface.co/api/datasets",
1040
- headers={'Accept': 'application/json'}, # Authorization ๋Œ€์‹  Accept ํ—ค๋” ์‚ฌ์šฉ
1041
- params=params
1042
- )
1043
 
1044
- if response.status_code == 200:
1045
- all_datasets.extend(response.json())
1046
- print(f"Fetched datasets {offset+1} to {offset+len(response.json())}")
1047
- else:
1048
- print(f"Failed to fetch datasets at offset {offset}: {response.status_code}")
1049
- break
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
- if is_korea:
1088
- # Korea ๋ฐ์ดํ„ฐ์…‹ ์ค‘์—์„œ์˜ ์ˆœ์œ„ ํ™•์ธ
1089
- korea_rank = next((idx for idx, d in enumerate(korea_datasets, 1)
1090
- if d.get('id', '').strip() == dataset_id.strip()), None)
1091
-
1092
- if korea_rank:
1093
- return min(global_rank or 10001, korea_rank + 1000), True
 
1094
 
1095
- return global_rank if global_rank else 'Not in top 10000', is_korea
 
 
 
1096
 
 
1097
  try:
1098
- progress(0, desc="Fetching datasets...")
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
- print(f"Total global datasets fetched: {len(all_global_datasets)}")
1116
- print(f"Total Korea datasets fetched: {len(korea_datasets)}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1117
 
1118
-
1119
 
1120
- filtered_datasets = []
1121
- for dataset_id in target_datasets.keys():
1122
- try:
1123
- normalized_id = dataset_id.strip('/')
1124
- dataset_url_api = f"https://huggingface.co/api/datasets/{normalized_id}"
1125
- response = requests.get(
1126
- dataset_url_api,
1127
- headers={'Authorization': f'Bearer {HF_TOKEN}'}
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 = go.Figure()
 
 
 
 
 
1161
 
1162
- if valid_datasets:
1163
- ids = [d['id'] for d in valid_datasets]
1164
- ranks = [d['global_rank'] for d in valid_datasets]
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
- # HTML ์นด๋“œ ์ƒ์„ฑ
1195
- html_content = """
1196
- <div style='padding: 20px; background: #f5f5f5;'>
1197
- <h2 style='color: #2c3e50;'>Datasets Rankings (Up to #3000)</h2>
1198
- <div style='display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;'>
1199
- """
1200
-
1201
- for dataset in filtered_datasets:
1202
- rank_display = f"Global Rank #{dataset['global_rank']}" if isinstance(dataset['global_rank'], (int, float)) else "Not in top 3000"
1203
- korea_badge = "๐Ÿ‡ฐ๐Ÿ‡ท Korea Search Result" if dataset['is_korea'] else ""
1204
-
1205
- html_content += f"""
1206
- <div style='
1207
- background: white;
1208
- padding: 20px;
1209
- border-radius: 10px;
1210
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
1211
- transition: transform 0.2s;
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, Models, Datasets์˜ ์‹ค์‹œ๊ฐ„ ์ธ๊ธฐ ์ˆœ์œ„๋ฅผ ๋ฐ˜์˜ํ•˜์—ฌ 'ํ•œ๊ตญ์•ˆ(๊ธฐ์—…/์–ธ์–ด)'์˜ ๋ฆฌ์ŠคํŠธ(๊ณต๊ฐœ,๊ฒ€์ƒ‰,๋ฆฌ๋”๋ณด๋“œ ๋“ฑ)๋งŒ ๋ถ„์„. (c)'ํ•œ๊ตญ์ธ๊ณต์ง€๋Šฅ์ง„ํฅํ˜‘ํšŒ' / ์š”์ฒญ: [email protected]
 
 
 
 
 
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
- with gr.Tab("Datasets Trending"):
1283
- datasets_plot = gr.Plot()
1284
- datasets_info = gr.HTML()
1285
- datasets_df = gr.DataFrame()
1286
-
1287
  def refresh_all_data():
1288
- spaces_results = get_spaces_data("trending")
1289
- models_results = get_models_data()
1290
- datasets_results = get_datasets_data()
1291
- return [
1292
- *spaces_results,
1293
- *models_results,
1294
- *datasets_results
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
- datasets_plot, datasets_info, datasets_df
1303
  ]
1304
  )
1305
 
1306
  # ์ดˆ๊ธฐ ๋ฐ์ดํ„ฐ ๋กœ๋“œ
1307
- spaces_results = get_spaces_data("trending")
1308
- models_results = get_models_data()
1309
- datasets_results = get_datasets_data()
1310
-
1311
- trending_plot.value, trending_info.value, trending_df.value = spaces_results
1312
- models_plot.value, models_info.value, models_df.value = models_results
1313
- datasets_plot.value, datasets_info.value, datasets_df.value = datasets_results
 
 
 
 
 
 
 
 
 
 
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
  )