Update index.html
Browse files- index.html +187 -49
index.html
CHANGED
|
@@ -307,8 +307,21 @@
|
|
| 307 |
</div>
|
| 308 |
|
| 309 |
<div class="note">
|
| 310 |
-
โ ๏ธ
|
| 311 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 312 |
</div>
|
| 313 |
</div>
|
| 314 |
|
|
@@ -358,17 +371,34 @@
|
|
| 358 |
container.innerHTML = '<div class="loading"><div class="loading-spinner"></div><p>๋ชจ๋ธ ๋ก๋ฉ ์ค...</p></div>';
|
| 359 |
|
| 360 |
try {
|
| 361 |
-
// HuggingFace API ์ฌ์ฉ
|
| 362 |
-
|
| 363 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 364 |
|
| 365 |
if (!response.ok) throw new Error('API ์์ฒญ ์คํจ');
|
| 366 |
|
| 367 |
const data = await response.json();
|
|
|
|
| 368 |
displayHFModels(data, container);
|
| 369 |
} catch (error) {
|
| 370 |
-
|
| 371 |
-
|
|
|
|
|
|
|
| 372 |
}
|
| 373 |
}
|
| 374 |
|
|
@@ -387,39 +417,102 @@
|
|
| 387 |
|
| 388 |
try {
|
| 389 |
// HuggingFace API ์ฌ์ฉ
|
| 390 |
-
|
| 391 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 392 |
|
| 393 |
if (!response.ok) throw new Error('API ์์ฒญ ์คํจ');
|
| 394 |
|
| 395 |
const data = await response.json();
|
|
|
|
| 396 |
displayHFSpaces(data, container);
|
| 397 |
} catch (error) {
|
| 398 |
-
|
| 399 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 400 |
}
|
| 401 |
}
|
| 402 |
|
| 403 |
// Replicate ๋ชจ๋ธ ๋ก๋
|
| 404 |
async function loadReplicate() {
|
|
|
|
| 405 |
const container = document.getElementById('replicate-content');
|
| 406 |
container.innerHTML = '<div class="loading"><div class="loading-spinner"></div><p>๋ชจ๋ธ ๋ก๋ฉ ์ค...</p></div>';
|
| 407 |
|
| 408 |
// Replicate๋ ๊ณต๊ฐ API๊ฐ ์ ํ์ ์ด๋ฏ๋ก ์ํ ๋ฐ์ดํฐ ํ์
|
|
|
|
| 409 |
displaySampleReplicateModels(container);
|
| 410 |
}
|
| 411 |
|
| 412 |
// HuggingFace Models ํ์
|
| 413 |
function displayHFModels(models, container) {
|
| 414 |
container.innerHTML = '';
|
| 415 |
-
models.forEach(model => {
|
| 416 |
const card = createModelCard({
|
| 417 |
-
|
| 418 |
-
|
|
|
|
| 419 |
likes: model.likes || 0,
|
| 420 |
downloads: model.downloads || 0,
|
| 421 |
-
|
| 422 |
-
|
|
|
|
|
|
|
|
|
|
| 423 |
});
|
| 424 |
container.appendChild(card);
|
| 425 |
});
|
|
@@ -428,14 +521,18 @@
|
|
| 428 |
// HuggingFace Spaces ํ์
|
| 429 |
function displayHFSpaces(spaces, container) {
|
| 430 |
container.innerHTML = '';
|
| 431 |
-
spaces.forEach(space => {
|
| 432 |
const card = createModelCard({
|
| 433 |
-
|
| 434 |
-
|
|
|
|
| 435 |
likes: space.likes || 0,
|
| 436 |
sdk: space.sdk || 'Unknown',
|
|
|
|
| 437 |
url: `https://huggingface.co/spaces/${space.id}`,
|
| 438 |
-
icon: '๐ฏ'
|
|
|
|
|
|
|
| 439 |
});
|
| 440 |
container.appendChild(card);
|
| 441 |
});
|
|
@@ -447,7 +544,17 @@
|
|
| 447 |
card.className = 'item-card';
|
| 448 |
card.onclick = () => window.open(data.url, '_blank');
|
| 449 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 450 |
card.innerHTML = `
|
|
|
|
|
|
|
|
|
|
| 451 |
<div class="item-header">
|
| 452 |
<div class="item-icon">${data.icon}</div>
|
| 453 |
<div class="item-info">
|
|
@@ -459,8 +566,15 @@
|
|
| 459 |
${data.likes !== undefined ? `<div class="stat">โค๏ธ ${formatNumber(data.likes)}</div>` : ''}
|
| 460 |
${data.downloads !== undefined ? `<div class="stat">โฌ๏ธ ${formatNumber(data.downloads)}</div>` : ''}
|
| 461 |
${data.sdk ? `<div class="stat">๐ ๏ธ ${data.sdk}</div>` : ''}
|
|
|
|
|
|
|
| 462 |
${data.runs !== undefined ? `<div class="stat">โถ๏ธ ${formatNumber(data.runs)}</div>` : ''}
|
| 463 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 464 |
`;
|
| 465 |
|
| 466 |
return card;
|
|
@@ -475,18 +589,24 @@
|
|
| 475 |
|
| 476 |
// ์ํ ๋ฐ์ดํฐ ํ์ ํจ์๋ค
|
| 477 |
function displaySampleHFModels(filter, container) {
|
|
|
|
| 478 |
const sampleData = filter === 'trending' ? [
|
| 479 |
-
{ title: '
|
| 480 |
-
{ title: 'DeepSeek-R1', author: 'deepseek-ai', likes: 10400, downloads: 567000, icon: '๐ค' },
|
| 481 |
-
{ title: '
|
| 482 |
-
{ title: 'FLUX.1-dev', author: 'black-forest-labs', likes: 29100, downloads: 397000, icon: '๐ค' },
|
| 483 |
-
{ title: '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 484 |
] : [
|
| 485 |
-
{ title: 'OmniGen2', author: '
|
| 486 |
-
{ title: 'VideoGen-Pro', author: 'ai-
|
| 487 |
-
{ title: 'CodeLLM-7B', author: '
|
| 488 |
-
{ title: 'MusicGen-
|
| 489 |
-
{ title: 'ImageEdit-XL', author: 'vision-lab', likes: 145, downloads: 789, icon: '๐ค' }
|
| 490 |
];
|
| 491 |
|
| 492 |
container.innerHTML = '';
|
|
@@ -497,18 +617,24 @@
|
|
| 497 |
}
|
| 498 |
|
| 499 |
function displaySampleHFSpaces(filter, container) {
|
|
|
|
| 500 |
const sampleData = filter === 'trending' ? [
|
| 501 |
-
{ title: 'stable-diffusion-webui', author: 'stabilityai', likes: 75500, sdk: 'Gradio', icon: '
|
| 502 |
-
{ title: 'chatgpt-clone', author: 'community', likes: 12300, sdk: 'Streamlit', icon: '
|
| 503 |
-
{ title: '
|
| 504 |
-
{ title: 'voice-clone', author: '
|
| 505 |
-
{ title: 'code-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 506 |
] : [
|
| 507 |
-
{ title: '
|
| 508 |
-
{ title: 'video-editor', author: 'creator', likes: 45, sdk: 'Streamlit', icon: '
|
| 509 |
-
{ title: 'data-viz', author: '
|
| 510 |
-
{ title: 'music-mixer', author: '
|
| 511 |
-
{ title: 'text-analyzer', author: 'nlp-
|
| 512 |
];
|
| 513 |
|
| 514 |
container.innerHTML = '';
|
|
@@ -519,15 +645,18 @@
|
|
| 519 |
}
|
| 520 |
|
| 521 |
function displaySampleReplicateModels(container) {
|
|
|
|
| 522 |
const sampleData = [
|
| 523 |
-
{ title: '
|
| 524 |
-
{ title: 'stable-diffusion-3', author: 'stability-ai', runs: 1750000, icon: '
|
| 525 |
-
{ title: 'whisper', author: 'openai', runs: 890000, icon: '
|
| 526 |
-
{ title: 'llama-
|
| 527 |
-
{ title: 'musicgen', author: 'facebook', runs: 450000, icon: '
|
| 528 |
-
{ title: 'animate-diff', author: 'lucataco', runs: 320000, icon: '
|
| 529 |
-
{ title: 'real-esrgan', author: 'xinntao', runs: 280000, icon: '
|
| 530 |
-
{ title: 'rembg', author: 'cjwbw', runs: 210000, icon: '
|
|
|
|
|
|
|
| 531 |
];
|
| 532 |
|
| 533 |
container.innerHTML = '';
|
|
@@ -549,7 +678,16 @@
|
|
| 549 |
}
|
| 550 |
|
| 551 |
// ์ด๊ธฐ ๋ก๋
|
| 552 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 553 |
</script>
|
| 554 |
</body>
|
| 555 |
</html>
|
|
|
|
| 307 |
</div>
|
| 308 |
|
| 309 |
<div class="note">
|
| 310 |
+
โ ๏ธ <strong>API ์ฌ์ฉ ์๋ด:</strong><br>
|
| 311 |
+
โข HuggingFace API: https://huggingface.co/api/models?sort=likes7d (ํธ๋ ๋ฉ), ?sort=created_at (์ ๊ท)<br>
|
| 312 |
+
โข CORS ์๋ฌ ๋ฐ์ ์ ํ๋ก์ ์๋ฒ ์ฌ์ฉ์ ๊ถ์ฅํฉ๋๋ค<br>
|
| 313 |
+
โข ์ค์ ์๋น์ค์์๋ ๋ฐฑ์๋ ์๋ฒ๋ฅผ ํตํด API๋ฅผ ํธ์ถํ๋ ๊ฒ์ด ์์ ์ ์
๋๋ค
|
| 314 |
+
</div>
|
| 315 |
+
|
| 316 |
+
<!-- API URLs Info -->
|
| 317 |
+
<div style="margin-top: 30px; background: #f8f9fa; padding: 20px; border-radius: 10px;">
|
| 318 |
+
<h3 style="margin-bottom: 15px; color: #333;">๐ API Endpoints</h3>
|
| 319 |
+
<div style="display: grid; gap: 10px; font-size: 0.9rem;">
|
| 320 |
+
<div><strong>HF Models (Trending):</strong> <code style="background: #e9ecef; padding: 2px 6px; border-radius: 4px;">https://huggingface.co/api/models?sort=likes7d&direction=-1&limit=30</code></div>
|
| 321 |
+
<div><strong>HF Models (New):</strong> <code style="background: #e9ecef; padding: 2px 6px; border-radius: 4px;">https://huggingface.co/api/models?sort=created_at&direction=-1&limit=30</code></div>
|
| 322 |
+
<div><strong>HF Spaces (Trending):</strong> <code style="background: #e9ecef; padding: 2px 6px; border-radius: 4px;">https://huggingface.co/api/spaces?sort=likes&direction=-1&limit=30</code></div>
|
| 323 |
+
<div><strong>HF Spaces (New):</strong> <code style="background: #e9ecef; padding: 2px 6px; border-radius: 4px;">https://huggingface.co/api/spaces?sort=created_at&direction=-1&limit=30</code></div>
|
| 324 |
+
</div>
|
| 325 |
</div>
|
| 326 |
</div>
|
| 327 |
|
|
|
|
| 371 |
container.innerHTML = '<div class="loading"><div class="loading-spinner"></div><p>๋ชจ๋ธ ๋ก๋ฉ ์ค...</p></div>';
|
| 372 |
|
| 373 |
try {
|
| 374 |
+
// HuggingFace API ์ฌ์ฉ - trending์ sort ํ๋ผ๋ฏธํฐ๋ก ์ฒ๋ฆฌ
|
| 375 |
+
let apiUrl;
|
| 376 |
+
if (filter === 'trending') {
|
| 377 |
+
// trending์ likes7d (7์ผ๊ฐ ์ข์์) ๋๋ likes๋ก ์ ๋ ฌ
|
| 378 |
+
apiUrl = 'https://huggingface.co/api/models?sort=likes7d&direction=-1&limit=30';
|
| 379 |
+
} else {
|
| 380 |
+
// ์ ๊ท๋ created_at์ผ๋ก ์ ๋ ฌ
|
| 381 |
+
apiUrl = 'https://huggingface.co/api/models?sort=created_at&direction=-1&limit=30';
|
| 382 |
+
}
|
| 383 |
+
|
| 384 |
+
console.log(`๐ก API ํธ์ถ ์ค: ${apiUrl}`);
|
| 385 |
+
const response = await fetch(apiUrl, {
|
| 386 |
+
method: 'GET',
|
| 387 |
+
headers: {
|
| 388 |
+
'Accept': 'application/json',
|
| 389 |
+
}
|
| 390 |
+
});
|
| 391 |
|
| 392 |
if (!response.ok) throw new Error('API ์์ฒญ ์คํจ');
|
| 393 |
|
| 394 |
const data = await response.json();
|
| 395 |
+
console.log(`โ
${data.length}๊ฐ์ ๋ชจ๋ธ ๋ก๋ ์๋ฃ`);
|
| 396 |
displayHFModels(data, container);
|
| 397 |
} catch (error) {
|
| 398 |
+
console.error('โ API ์๋ฌ:', error);
|
| 399 |
+
console.log('๐ ํ๋ก์ ์๋ฒ๋ฅผ ํตํ ์์ฒญ์ ์๋ํฉ๋๋ค...');
|
| 400 |
+
// CORS ์๋ฌ ์ ํ๋ก์ ์ฌ์ฉ ์๋
|
| 401 |
+
tryProxyRequest('models', filter, container);
|
| 402 |
}
|
| 403 |
}
|
| 404 |
|
|
|
|
| 417 |
|
| 418 |
try {
|
| 419 |
// HuggingFace API ์ฌ์ฉ
|
| 420 |
+
let apiUrl;
|
| 421 |
+
if (filter === 'trending') {
|
| 422 |
+
// trending์ likes๋ก ์ ๋ ฌ
|
| 423 |
+
apiUrl = 'https://huggingface.co/api/spaces?sort=likes&direction=-1&limit=30';
|
| 424 |
+
} else {
|
| 425 |
+
// ์ ๊ท๋ created_at์ผ๋ก ์ ๋ ฌ
|
| 426 |
+
apiUrl = 'https://huggingface.co/api/spaces?sort=created_at&direction=-1&limit=30';
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
console.log(`๐ก API ํธ์ถ ์ค: ${apiUrl}`);
|
| 430 |
+
const response = await fetch(apiUrl, {
|
| 431 |
+
method: 'GET',
|
| 432 |
+
headers: {
|
| 433 |
+
'Accept': 'application/json',
|
| 434 |
+
}
|
| 435 |
+
});
|
| 436 |
|
| 437 |
if (!response.ok) throw new Error('API ์์ฒญ ์คํจ');
|
| 438 |
|
| 439 |
const data = await response.json();
|
| 440 |
+
console.log(`โ
${data.length}๊ฐ์ ์คํ์ด์ค ๋ก๋ ์๋ฃ`);
|
| 441 |
displayHFSpaces(data, container);
|
| 442 |
} catch (error) {
|
| 443 |
+
console.error('โ API ์๋ฌ:', error);
|
| 444 |
+
console.log('๐ ํ๋ก์ ์๋ฒ๋ฅผ ํตํ ์์ฒญ์ ์๋ํฉ๋๋ค...');
|
| 445 |
+
// CORS ์๋ฌ ์ ํ๋ก์ ์ฌ์ฉ ์๋
|
| 446 |
+
tryProxyRequest('spaces', filter, container);
|
| 447 |
+
}
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
// ํ๋ก์๋ฅผ ํตํ ์์ฒญ ์๋
|
| 451 |
+
async function tryProxyRequest(type, filter, container) {
|
| 452 |
+
try {
|
| 453 |
+
console.log('๐ ํ๋ก์๋ฅผ ํตํ ์์ฒญ ์๋ ์ค...');
|
| 454 |
+
// ๊ณต๊ฐ CORS ํ๋ก์ ์ฌ์ฉ (์: cors-anywhere)
|
| 455 |
+
const proxyUrl = 'https://api.allorigins.win/raw?url=';
|
| 456 |
+
let targetUrl;
|
| 457 |
+
|
| 458 |
+
if (type === 'models') {
|
| 459 |
+
targetUrl = filter === 'trending'
|
| 460 |
+
? 'https://huggingface.co/api/models?sort=likes7d&direction=-1&limit=30'
|
| 461 |
+
: 'https://huggingface.co/api/models?sort=created_at&direction=-1&limit=30';
|
| 462 |
+
} else {
|
| 463 |
+
targetUrl = filter === 'trending'
|
| 464 |
+
? 'https://huggingface.co/api/spaces?sort=likes&direction=-1&limit=30'
|
| 465 |
+
: 'https://huggingface.co/api/spaces?sort=created_at&direction=-1&limit=30';
|
| 466 |
+
}
|
| 467 |
+
|
| 468 |
+
console.log(`๐ก ํ๋ก์ URL: ${proxyUrl + encodeURIComponent(targetUrl)}`);
|
| 469 |
+
const response = await fetch(proxyUrl + encodeURIComponent(targetUrl));
|
| 470 |
+
const data = await response.json();
|
| 471 |
+
|
| 472 |
+
console.log(`โ
ํ๋ก์๋ฅผ ํตํด ${data.length}๊ฐ์ ๋ฐ์ดํฐ ๋ก๋ ์๋ฃ`);
|
| 473 |
+
if (type === 'models') {
|
| 474 |
+
displayHFModels(data, container);
|
| 475 |
+
} else {
|
| 476 |
+
displayHFSpaces(data, container);
|
| 477 |
+
}
|
| 478 |
+
} catch (error) {
|
| 479 |
+
console.error('โ ํ๋ก์ ์์ฒญ๋ ์คํจ:', error);
|
| 480 |
+
console.log('๐ ์ํ ๋ฐ์ดํฐ๋ฅผ ํ์ํฉ๋๋ค.');
|
| 481 |
+
// ๋ชจ๋ ์๋ ์คํจ ์ ์ํ ๋ฐ์ดํฐ ํ์
|
| 482 |
+
if (type === 'models') {
|
| 483 |
+
displaySampleHFModels(filter, container);
|
| 484 |
+
} else {
|
| 485 |
+
displaySampleHFSpaces(filter, container);
|
| 486 |
+
}
|
| 487 |
}
|
| 488 |
}
|
| 489 |
|
| 490 |
// Replicate ๋ชจ๋ธ ๋ก๋
|
| 491 |
async function loadReplicate() {
|
| 492 |
+
console.log('๐ Replicate ๋ชจ๋ธ ๋ก๋ ์์');
|
| 493 |
const container = document.getElementById('replicate-content');
|
| 494 |
container.innerHTML = '<div class="loading"><div class="loading-spinner"></div><p>๋ชจ๋ธ ๋ก๋ฉ ์ค...</p></div>';
|
| 495 |
|
| 496 |
// Replicate๋ ๊ณต๊ฐ API๊ฐ ์ ํ์ ์ด๋ฏ๋ก ์ํ ๋ฐ์ดํฐ ํ์
|
| 497 |
+
console.log('โน๏ธ Replicate๋ ๊ณต๊ฐ API๊ฐ ์ ํ์ ์ด๋ฏ๋ก ์ํ ๋ฐ์ดํฐ๋ฅผ ํ์ํฉ๋๋ค.');
|
| 498 |
displaySampleReplicateModels(container);
|
| 499 |
}
|
| 500 |
|
| 501 |
// HuggingFace Models ํ์
|
| 502 |
function displayHFModels(models, container) {
|
| 503 |
container.innerHTML = '';
|
| 504 |
+
models.forEach((model, index) => {
|
| 505 |
const card = createModelCard({
|
| 506 |
+
rank: index + 1,
|
| 507 |
+
title: model.id?.split('/')[1] || model.modelId || 'Unknown',
|
| 508 |
+
author: model.id?.split('/')[0] || model.author || 'Unknown',
|
| 509 |
likes: model.likes || 0,
|
| 510 |
downloads: model.downloads || 0,
|
| 511 |
+
tags: model.tags || [],
|
| 512 |
+
pipeline_tag: model.pipeline_tag || '',
|
| 513 |
+
url: `https://huggingface.co/${model.id || model.modelId}`,
|
| 514 |
+
icon: '๐ค',
|
| 515 |
+
updated: model.lastModified || model.created_at
|
| 516 |
});
|
| 517 |
container.appendChild(card);
|
| 518 |
});
|
|
|
|
| 521 |
// HuggingFace Spaces ํ์
|
| 522 |
function displayHFSpaces(spaces, container) {
|
| 523 |
container.innerHTML = '';
|
| 524 |
+
spaces.forEach((space, index) => {
|
| 525 |
const card = createModelCard({
|
| 526 |
+
rank: index + 1,
|
| 527 |
+
title: space.id?.split('/')[1] || 'Unknown',
|
| 528 |
+
author: space.id?.split('/')[0] || 'Unknown',
|
| 529 |
likes: space.likes || 0,
|
| 530 |
sdk: space.sdk || 'Unknown',
|
| 531 |
+
emoji: space.emoji || '๐ฏ',
|
| 532 |
url: `https://huggingface.co/spaces/${space.id}`,
|
| 533 |
+
icon: space.emoji || '๐ฏ',
|
| 534 |
+
hardware: space.hardware || 'CPU',
|
| 535 |
+
updated: space.lastModified || space.created_at
|
| 536 |
});
|
| 537 |
container.appendChild(card);
|
| 538 |
});
|
|
|
|
| 544 |
card.className = 'item-card';
|
| 545 |
card.onclick = () => window.open(data.url, '_blank');
|
| 546 |
|
| 547 |
+
// ์์์ ๋ฐ๋ฅธ ์์
|
| 548 |
+
let rankColor = '#999';
|
| 549 |
+
if (data.rank === 1) rankColor = '#FFD700';
|
| 550 |
+
else if (data.rank === 2) rankColor = '#C0C0C0';
|
| 551 |
+
else if (data.rank === 3) rankColor = '#CD7F32';
|
| 552 |
+
else if (data.rank <= 10) rankColor = '#667eea';
|
| 553 |
+
|
| 554 |
card.innerHTML = `
|
| 555 |
+
<div class="rank-badge" style="position: absolute; top: 10px; right: 10px; background: ${rankColor}; color: white; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 0.9rem;">
|
| 556 |
+
${data.rank}
|
| 557 |
+
</div>
|
| 558 |
<div class="item-header">
|
| 559 |
<div class="item-icon">${data.icon}</div>
|
| 560 |
<div class="item-info">
|
|
|
|
| 566 |
${data.likes !== undefined ? `<div class="stat">โค๏ธ ${formatNumber(data.likes)}</div>` : ''}
|
| 567 |
${data.downloads !== undefined ? `<div class="stat">โฌ๏ธ ${formatNumber(data.downloads)}</div>` : ''}
|
| 568 |
${data.sdk ? `<div class="stat">๐ ๏ธ ${data.sdk}</div>` : ''}
|
| 569 |
+
${data.hardware ? `<div class="stat">๐ป ${data.hardware}</div>` : ''}
|
| 570 |
+
${data.pipeline_tag ? `<div class="stat">๐ท๏ธ ${data.pipeline_tag}</div>` : ''}
|
| 571 |
${data.runs !== undefined ? `<div class="stat">โถ๏ธ ${formatNumber(data.runs)}</div>` : ''}
|
| 572 |
</div>
|
| 573 |
+
${data.tags && data.tags.length > 0 ? `
|
| 574 |
+
<div style="margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px;">
|
| 575 |
+
${data.tags.slice(0, 3).map(tag => `<span style="background: #f0f0f0; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; color: #666;">${tag}</span>`).join('')}
|
| 576 |
+
</div>
|
| 577 |
+
` : ''}
|
| 578 |
`;
|
| 579 |
|
| 580 |
return card;
|
|
|
|
| 589 |
|
| 590 |
// ์ํ ๋ฐ์ดํฐ ํ์ ํจ์๋ค
|
| 591 |
function displaySampleHFModels(filter, container) {
|
| 592 |
+
console.log(`๐ ${filter === 'trending' ? 'ํธ๋ ๋ฉ' : '์ ๊ท'} ๋ชจ๋ธ ์ํ ๋ฐ์ดํฐ๋ฅผ ํ์ํฉ๋๋ค.`);
|
| 593 |
const sampleData = filter === 'trending' ? [
|
| 594 |
+
{ rank: 1, title: 'Llama-3.3-70B-Instruct', author: 'meta-llama', likes: 177000, downloads: 1150000, icon: '๐ค', pipeline_tag: 'text-generation', tags: ['llama', '70b', 'instruct'] },
|
| 595 |
+
{ rank: 2, title: 'DeepSeek-R1-Distill-Qwen-32B', author: 'deepseek-ai', likes: 10400, downloads: 567000, icon: '๐ค', pipeline_tag: 'text-generation', tags: ['deepseek', 'reasoning'] },
|
| 596 |
+
{ rank: 3, title: 'Qwen3-235B-A22B', author: 'Qwen', likes: 5370, downloads: 225000, icon: '๐ค', pipeline_tag: 'text-generation', tags: ['qwen', 'large'] },
|
| 597 |
+
{ rank: 4, title: 'FLUX.1-dev', author: 'black-forest-labs', likes: 29100, downloads: 397000, icon: '๐ค', pipeline_tag: 'text-to-image', tags: ['flux', 'diffusion'] },
|
| 598 |
+
{ rank: 5, title: 'Phi-4', author: 'microsoft', likes: 8900, downloads: 156000, icon: '๐ค', pipeline_tag: 'text-generation', tags: ['phi', 'small'] },
|
| 599 |
+
{ rank: 6, title: 'stable-diffusion-3.5-large', author: 'stabilityai', likes: 7650, downloads: 234000, icon: '๐ค', pipeline_tag: 'text-to-image', tags: ['sd3', 'large'] },
|
| 600 |
+
{ rank: 7, title: 'whisper-large-v3-turbo', author: 'openai', likes: 6780, downloads: 189000, icon: '๐ค', pipeline_tag: 'automatic-speech-recognition', tags: ['whisper', 'asr'] },
|
| 601 |
+
{ rank: 8, title: 'MusicGen-Stereo-Melody', author: 'facebook', likes: 5430, downloads: 98000, icon: '๐ค', pipeline_tag: 'text-to-audio', tags: ['music', 'generation'] },
|
| 602 |
+
{ rank: 9, title: 'Florence-2-large', author: 'microsoft', likes: 4890, downloads: 87000, icon: '๐ค', pipeline_tag: 'image-text-to-text', tags: ['vision', 'florence'] },
|
| 603 |
+
{ rank: 10, title: 'QwQ-32B-Preview', author: 'Qwen', likes: 4560, downloads: 76000, icon: '๐ค', pipeline_tag: 'text-generation', tags: ['reasoning', 'cot'] }
|
| 604 |
] : [
|
| 605 |
+
{ rank: 1, title: 'OmniGen2', author: 'BAAI', likes: 156, downloads: 890, icon: '๐ค', pipeline_tag: 'image-generation', tags: ['new', 'omnigen'] },
|
| 606 |
+
{ rank: 2, title: 'VideoGen-Pro-2B', author: 'ai-lab', likes: 89, downloads: 234, icon: '๐ค', pipeline_tag: 'text-to-video', tags: ['video', 'new'] },
|
| 607 |
+
{ rank: 3, title: 'CodeLLM-7B-Python', author: 'code-ai', likes: 234, downloads: 1200, icon: '๐ค', pipeline_tag: 'text-generation', tags: ['code', 'python'] },
|
| 608 |
+
{ rank: 4, title: 'MusicGen-Remix', author: 'audio-ml', likes: 67, downloads: 456, icon: '๐ค', pipeline_tag: 'audio-to-audio', tags: ['music', 'remix'] },
|
| 609 |
+
{ rank: 5, title: 'ImageEdit-XL-v2', author: 'vision-lab', likes: 145, downloads: 789, icon: '๐ค', pipeline_tag: 'image-to-image', tags: ['editing', 'xl'] }
|
| 610 |
];
|
| 611 |
|
| 612 |
container.innerHTML = '';
|
|
|
|
| 617 |
}
|
| 618 |
|
| 619 |
function displaySampleHFSpaces(filter, container) {
|
| 620 |
+
console.log(`๐ ${filter === 'trending' ? 'ํธ๋ ๋ฉ' : '์ ๊ท'} ์คํ์ด์ค ์ํ ๋ฐ์ดํฐ๋ฅผ ํ์ํฉ๋๋ค.`);
|
| 621 |
const sampleData = filter === 'trending' ? [
|
| 622 |
+
{ rank: 1, title: 'stable-diffusion-webui', author: 'stabilityai', likes: 75500, sdk: 'Gradio', icon: '๐จ', hardware: 'T4 GPU' },
|
| 623 |
+
{ rank: 2, title: 'chatgpt-clone', author: 'community', likes: 12300, sdk: 'Streamlit', icon: '๐ฌ', hardware: 'CPU' },
|
| 624 |
+
{ rank: 3, title: 'InstantID', author: 'InstantX', likes: 8590, sdk: 'Gradio', icon: '๐ค', hardware: 'A10G' },
|
| 625 |
+
{ rank: 4, title: 'voice-clone-xtts', author: 'coqui', likes: 5640, sdk: 'Gradio', icon: '๐ค', hardware: 'T4 GPU' },
|
| 626 |
+
{ rank: 5, title: 'code-llama-playground', author: 'meta', likes: 3210, sdk: 'Gradio', icon: '๐ป', hardware: 'A100' },
|
| 627 |
+
{ rank: 6, title: 'image-to-3d-model', author: '3d-ai', likes: 2890, sdk: 'Gradio', icon: '๐ฒ', hardware: 'A10G' },
|
| 628 |
+
{ rank: 7, title: 'music-visualizer', author: 'audio-viz', likes: 2340, sdk: 'Streamlit', icon: '๐ต', hardware: 'CPU' },
|
| 629 |
+
{ rank: 8, title: 'pdf-chatbot', author: 'doc-ai', likes: 1980, sdk: 'Gradio', icon: '๐', hardware: 'T4 GPU' },
|
| 630 |
+
{ rank: 9, title: 'anime-art-generator', author: 'waifu-ai', likes: 1670, sdk: 'Gradio', icon: '๐', hardware: 'T4 GPU' },
|
| 631 |
+
{ rank: 10, title: 'dataset-explorer', author: 'data-tools', likes: 1450, sdk: 'Streamlit', icon: '๐', hardware: 'CPU' }
|
| 632 |
] : [
|
| 633 |
+
{ rank: 1, title: 'llm-arena', author: 'benchmark', likes: 23, sdk: 'Gradio', icon: '๐', hardware: 'A100' },
|
| 634 |
+
{ rank: 2, title: 'video-editor-ai', author: 'creator-tools', likes: 45, sdk: 'Streamlit', icon: '๐ฌ', hardware: 'T4 GPU' },
|
| 635 |
+
{ rank: 3, title: 'data-viz-dashboard', author: 'analytics', likes: 67, sdk: 'Streamlit', icon: '๐', hardware: 'CPU' },
|
| 636 |
+
{ rank: 4, title: 'music-mixer-ai', author: 'dj-ai', likes: 34, sdk: 'Gradio', icon: '๐ง', hardware: 'CPU' },
|
| 637 |
+
{ rank: 5, title: 'text-analyzer-pro', author: 'nlp-tools', likes: 56, sdk: 'Gradio', icon: '๐', hardware: 'CPU' }
|
| 638 |
];
|
| 639 |
|
| 640 |
container.innerHTML = '';
|
|
|
|
| 645 |
}
|
| 646 |
|
| 647 |
function displaySampleReplicateModels(container) {
|
| 648 |
+
console.log('๐ Replicate ์ธ๊ธฐ ๋ชจ๋ธ ์ํ ๋ฐ์ดํฐ๋ฅผ ํ์ํฉ๋๋ค.');
|
| 649 |
const sampleData = [
|
| 650 |
+
{ rank: 1, title: 'flux-1.1-pro', author: 'black-forest-labs', runs: 2910000, icon: '๐จ' },
|
| 651 |
+
{ rank: 2, title: 'stable-diffusion-3', author: 'stability-ai', runs: 1750000, icon: '๐ผ๏ธ' },
|
| 652 |
+
{ rank: 3, title: 'whisper-large-v3', author: 'openai', runs: 890000, icon: '๐ค' },
|
| 653 |
+
{ rank: 4, title: 'llama-3.3-70b', author: 'meta', runs: 670000, icon: '๐ค' },
|
| 654 |
+
{ rank: 5, title: 'musicgen-melody', author: 'facebook', runs: 450000, icon: '๐ต' },
|
| 655 |
+
{ rank: 6, title: 'animate-diff', author: 'lucataco', runs: 320000, icon: '๐ฌ' },
|
| 656 |
+
{ rank: 7, title: 'real-esrgan', author: 'xinntao', runs: 280000, icon: '๐' },
|
| 657 |
+
{ rank: 8, title: 'rembg', author: 'cjwbw', runs: 210000, icon: 'โ๏ธ' },
|
| 658 |
+
{ rank: 9, title: 'gfpgan', author: 'tencentarc', runs: 178000, icon: '๐ค' },
|
| 659 |
+
{ rank: 10, title: 'codeformer', author: 'sczhou', runs: 156000, icon: 'โจ' }
|
| 660 |
];
|
| 661 |
|
| 662 |
container.innerHTML = '';
|
|
|
|
| 678 |
}
|
| 679 |
|
| 680 |
// ์ด๊ธฐ ๋ก๋
|
| 681 |
+
window.addEventListener('DOMContentLoaded', () => {
|
| 682 |
+
console.log('๐ HuggingFace & Replicate ํธ๋ ๋ฉ ๋ฆฌ์คํธ ๋ก๋ ์์');
|
| 683 |
+
console.log('๐ API Endpoints:');
|
| 684 |
+
console.log('- HF Models (Trending): https://huggingface.co/api/models?sort=likes7d&direction=-1&limit=30');
|
| 685 |
+
console.log('- HF Models (New): https://huggingface.co/api/models?sort=created_at&direction=-1&limit=30');
|
| 686 |
+
console.log('- HF Spaces (Trending): https://huggingface.co/api/spaces?sort=likes&direction=-1&limit=30');
|
| 687 |
+
console.log('- HF Spaces (New): https://huggingface.co/api/spaces?sort=created_at&direction=-1&limit=30');
|
| 688 |
+
|
| 689 |
+
loadHFModels('trending');
|
| 690 |
+
});
|
| 691 |
</script>
|
| 692 |
</body>
|
| 693 |
</html>
|