Update index.html
Browse files- index.html +85 -106
index.html
CHANGED
@@ -103,6 +103,7 @@
|
|
103 |
background: white;
|
104 |
border-radius: 12px;
|
105 |
padding: 20px;
|
|
|
106 |
box-shadow: 0 2px 10px rgba(0,0,0,0.08);
|
107 |
transition: all 0.3s ease;
|
108 |
cursor: pointer;
|
@@ -251,7 +252,7 @@
|
|
251 |
</head>
|
252 |
<body>
|
253 |
<div class="container">
|
254 |
-
<h1>π AI λͺ¨λΈ
|
255 |
|
256 |
<div class="category-tabs">
|
257 |
<button class="tab-button active" onclick="showCategory('hf-models')">
|
@@ -267,9 +268,8 @@
|
|
267 |
|
268 |
<!-- HuggingFace Models Section -->
|
269 |
<div id="hf-models" class="content-section active">
|
270 |
-
<div
|
271 |
-
<
|
272 |
-
<button class="filter-btn" onclick="loadHFModels('new')">π μ κ·</button>
|
273 |
</div>
|
274 |
<div id="hf-models-content" class="items-grid">
|
275 |
<div class="loading">
|
@@ -281,9 +281,8 @@
|
|
281 |
|
282 |
<!-- HuggingFace Spaces Section -->
|
283 |
<div id="hf-spaces" class="content-section">
|
284 |
-
<div
|
285 |
-
<
|
286 |
-
<button class="filter-btn" onclick="loadHFSpaces('new')">π μ κ·</button>
|
287 |
</div>
|
288 |
<div id="hf-spaces-content" class="items-grid">
|
289 |
<div class="loading">
|
@@ -296,7 +295,8 @@
|
|
296 |
<!-- Replicate Section -->
|
297 |
<div id="replicate" class="content-section">
|
298 |
<div class="filter-buttons">
|
299 |
-
<button class="filter-btn active" onclick="loadReplicate()"
|
|
|
300 |
</div>
|
301 |
<div id="replicate-content" class="items-grid">
|
302 |
<div class="loading">
|
@@ -308,9 +308,9 @@
|
|
308 |
|
309 |
<div class="note">
|
310 |
β οΈ <strong>API μ¬μ© μλ΄:</strong><br>
|
311 |
-
β’ HuggingFace API
|
312 |
β’ CORS μλ¬ λ°μ μ νλ‘μ μλ² μ¬μ©μ κΆμ₯ν©λλ€<br>
|
313 |
-
β’
|
314 |
</div>
|
315 |
|
316 |
<!-- API URLs Info -->
|
@@ -318,9 +318,10 @@
|
|
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
|
322 |
-
<div
|
323 |
-
|
|
|
324 |
</div>
|
325 |
</div>
|
326 |
</div>
|
@@ -329,7 +330,6 @@
|
|
329 |
|
330 |
<script>
|
331 |
let currentCategory = 'hf-models';
|
332 |
-
let currentFilter = 'trending';
|
333 |
|
334 |
// μΉ΄ν
κ³ λ¦¬ μ ν
|
335 |
function showCategory(category) {
|
@@ -349,37 +349,22 @@
|
|
349 |
|
350 |
// λ°μ΄ν° λ‘λ
|
351 |
if (category === 'hf-models') {
|
352 |
-
loadHFModels(
|
353 |
} else if (category === 'hf-spaces') {
|
354 |
-
loadHFSpaces(
|
355 |
} else if (category === 'replicate') {
|
356 |
-
loadReplicate();
|
357 |
}
|
358 |
}
|
359 |
|
360 |
// HuggingFace Models λ‘λ
|
361 |
-
async function loadHFModels(
|
362 |
-
currentFilter = filter;
|
363 |
-
|
364 |
-
// νν° λ²νΌ νμ±ν
|
365 |
-
document.querySelectorAll('#hf-models .filter-btn').forEach(btn => {
|
366 |
-
btn.classList.remove('active');
|
367 |
-
});
|
368 |
-
event.target.classList.add('active');
|
369 |
-
|
370 |
const container = document.getElementById('hf-models-content');
|
371 |
container.innerHTML = '<div class="loading"><div class="loading-spinner"></div><p>λͺ¨λΈ λ‘λ© μ€...</p></div>';
|
372 |
|
373 |
try {
|
374 |
-
// HuggingFace API μ¬μ© - trending
|
375 |
-
|
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, {
|
@@ -398,33 +383,18 @@
|
|
398 |
console.error('β API μλ¬:', error);
|
399 |
console.log('π νλ‘μ μλ²λ₯Ό ν΅ν μμ²μ μλν©λλ€...');
|
400 |
// CORS μλ¬ μ νλ‘μ μ¬μ© μλ
|
401 |
-
tryProxyRequest('models',
|
402 |
}
|
403 |
}
|
404 |
|
405 |
// HuggingFace Spaces λ‘λ
|
406 |
-
async function loadHFSpaces(
|
407 |
-
currentFilter = filter;
|
408 |
-
|
409 |
-
// νν° λ²νΌ νμ±ν
|
410 |
-
document.querySelectorAll('#hf-spaces .filter-btn').forEach(btn => {
|
411 |
-
btn.classList.remove('active');
|
412 |
-
});
|
413 |
-
event.target.classList.add('active');
|
414 |
-
|
415 |
const container = document.getElementById('hf-spaces-content');
|
416 |
container.innerHTML = '<div class="loading"><div class="loading-spinner"></div><p>μ€νμ΄μ€ λ‘λ© μ€...</p></div>';
|
417 |
|
418 |
try {
|
419 |
-
// HuggingFace API μ¬μ©
|
420 |
-
|
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, {
|
@@ -443,12 +413,12 @@
|
|
443 |
console.error('β API μλ¬:', error);
|
444 |
console.log('π νλ‘μ μλ²λ₯Ό ν΅ν μμ²μ μλν©λλ€...');
|
445 |
// CORS μλ¬ μ νλ‘μ μ¬μ© μλ
|
446 |
-
tryProxyRequest('spaces',
|
447 |
}
|
448 |
}
|
449 |
|
450 |
// νλ‘μλ₯Ό ν΅ν μμ² μλ
|
451 |
-
async function tryProxyRequest(type,
|
452 |
try {
|
453 |
console.log('π νλ‘μλ₯Ό ν΅ν μμ² μλ μ€...');
|
454 |
// κ³΅κ° CORS νλ‘μ μ¬μ© (μ: cors-anywhere)
|
@@ -456,13 +426,9 @@
|
|
456 |
let targetUrl;
|
457 |
|
458 |
if (type === 'models') {
|
459 |
-
targetUrl =
|
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 =
|
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)}`);
|
@@ -480,22 +446,34 @@
|
|
480 |
console.log('π μν λ°μ΄ν°λ₯Ό νμν©λλ€.');
|
481 |
// λͺ¨λ μλ μ€ν¨ μ μν λ°μ΄ν° νμ
|
482 |
if (type === 'models') {
|
483 |
-
displaySampleHFModels(
|
484 |
} else {
|
485 |
-
displaySampleHFSpaces(
|
486 |
}
|
487 |
}
|
488 |
}
|
489 |
|
490 |
// Replicate λͺ¨λΈ λ‘λ
|
491 |
-
async function loadReplicate() {
|
492 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(
|
498 |
-
displaySampleReplicateModels(container);
|
499 |
}
|
500 |
|
501 |
// HuggingFace Models νμ
|
@@ -555,6 +533,7 @@
|
|
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">
|
@@ -588,9 +567,9 @@
|
|
588 |
}
|
589 |
|
590 |
// μν λ°μ΄ν° νμ ν¨μλ€
|
591 |
-
function displaySampleHFModels(
|
592 |
-
console.log(`π
|
593 |
-
const sampleData =
|
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'] },
|
@@ -601,12 +580,6 @@
|
|
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 = '';
|
@@ -616,9 +589,9 @@
|
|
616 |
});
|
617 |
}
|
618 |
|
619 |
-
function displaySampleHFSpaces(
|
620 |
-
console.log(`π
|
621 |
-
const sampleData =
|
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' },
|
@@ -629,12 +602,6 @@
|
|
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 = '';
|
@@ -644,21 +611,33 @@
|
|
644 |
});
|
645 |
}
|
646 |
|
647 |
-
function displaySampleReplicateModels(container) {
|
648 |
-
console.log(
|
649 |
-
|
650 |
-
|
651 |
-
{ rank:
|
652 |
-
{ rank:
|
653 |
-
{ rank:
|
654 |
-
{ rank:
|
655 |
-
{ rank:
|
656 |
-
{ rank:
|
657 |
-
{ rank:
|
658 |
-
{ rank:
|
659 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
660 |
];
|
661 |
|
|
|
|
|
662 |
container.innerHTML = '';
|
663 |
sampleData.forEach(model => {
|
664 |
model.url = `https://replicate.com/${model.author}/${model.title}`;
|
@@ -669,11 +648,13 @@
|
|
669 |
// μλ‘κ³ μΉ¨
|
670 |
function refreshCurrent() {
|
671 |
if (currentCategory === 'hf-models') {
|
672 |
-
loadHFModels(
|
673 |
} else if (currentCategory === 'hf-spaces') {
|
674 |
-
loadHFSpaces(
|
675 |
} else {
|
676 |
-
|
|
|
|
|
677 |
}
|
678 |
}
|
679 |
|
@@ -682,11 +663,9 @@
|
|
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
|
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(
|
690 |
});
|
691 |
</script>
|
692 |
</body>
|
|
|
103 |
background: white;
|
104 |
border-radius: 12px;
|
105 |
padding: 20px;
|
106 |
+
padding-top: 30px;
|
107 |
box-shadow: 0 2px 10px rgba(0,0,0,0.08);
|
108 |
transition: all 0.3s ease;
|
109 |
cursor: pointer;
|
|
|
252 |
</head>
|
253 |
<body>
|
254 |
<div class="container">
|
255 |
+
<h1>π AI λͺ¨λΈ νΈλ λ© λ¦¬μ€νΈ</h1>
|
256 |
|
257 |
<div class="category-tabs">
|
258 |
<button class="tab-button active" onclick="showCategory('hf-models')">
|
|
|
268 |
|
269 |
<!-- HuggingFace Models Section -->
|
270 |
<div id="hf-models" class="content-section active">
|
271 |
+
<div style="text-align: center; margin-bottom: 20px;">
|
272 |
+
<h2 style="color: #667eea;">π Trending Models</h2>
|
|
|
273 |
</div>
|
274 |
<div id="hf-models-content" class="items-grid">
|
275 |
<div class="loading">
|
|
|
281 |
|
282 |
<!-- HuggingFace Spaces Section -->
|
283 |
<div id="hf-spaces" class="content-section">
|
284 |
+
<div style="text-align: center; margin-bottom: 20px;">
|
285 |
+
<h2 style="color: #667eea;">π Trending Spaces</h2>
|
|
|
286 |
</div>
|
287 |
<div id="hf-spaces-content" class="items-grid">
|
288 |
<div class="loading">
|
|
|
295 |
<!-- Replicate Section -->
|
296 |
<div id="replicate" class="content-section">
|
297 |
<div class="filter-buttons">
|
298 |
+
<button class="filter-btn active" onclick="loadReplicate('featured')">β Featured Models</button>
|
299 |
+
<button class="filter-btn" onclick="loadReplicate('official')">β
Official Models</button>
|
300 |
</div>
|
301 |
<div id="replicate-content" class="items-grid">
|
302 |
<div class="loading">
|
|
|
308 |
|
309 |
<div class="note">
|
310 |
β οΈ <strong>API μ¬μ© μλ΄:</strong><br>
|
311 |
+
β’ HuggingFace APIλ `likes7d`λ‘ 7μΌκ° νΈλ λ©μ μ νν μΆμΆν©λλ€<br>
|
312 |
β’ CORS μλ¬ λ°μ μ νλ‘μ μλ² μ¬μ©μ κΆμ₯ν©λλ€<br>
|
313 |
+
β’ Replicateμ Featured/Official λͺ¨λΈμ 곡μ μΉμ¬μ΄νΈμμ νμΈ κ°λ₯ν©λλ€
|
314 |
</div>
|
315 |
|
316 |
<!-- API URLs Info -->
|
|
|
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 Spaces (Trending):</strong> <code style="background: #e9ecef; padding: 2px 6px; border-radius: 4px;">https://huggingface.co/api/spaces?sort=likes7d&direction=-1&limit=30</code></div>
|
322 |
+
<div style="margin-top: 10px; color: #666;">
|
323 |
+
<strong>Note:</strong> Replicate Featured/Official λͺ¨λΈμ μΉ νμ΄μ§ μ€ν¬λνμ΄λ μΈμ¦λ API μ‘μΈμ€κ° νμν©λλ€.
|
324 |
+
</div>
|
325 |
</div>
|
326 |
</div>
|
327 |
</div>
|
|
|
330 |
|
331 |
<script>
|
332 |
let currentCategory = 'hf-models';
|
|
|
333 |
|
334 |
// μΉ΄ν
κ³ λ¦¬ μ ν
|
335 |
function showCategory(category) {
|
|
|
349 |
|
350 |
// λ°μ΄ν° λ‘λ
|
351 |
if (category === 'hf-models') {
|
352 |
+
loadHFModels();
|
353 |
} else if (category === 'hf-spaces') {
|
354 |
+
loadHFSpaces();
|
355 |
} else if (category === 'replicate') {
|
356 |
+
loadReplicate('featured');
|
357 |
}
|
358 |
}
|
359 |
|
360 |
// HuggingFace Models λ‘λ
|
361 |
+
async function loadHFModels() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
362 |
const container = document.getElementById('hf-models-content');
|
363 |
container.innerHTML = '<div class="loading"><div class="loading-spinner"></div><p>λͺ¨λΈ λ‘λ© μ€...</p></div>';
|
364 |
|
365 |
try {
|
366 |
+
// HuggingFace API μ¬μ© - trending (7μΌκ° μ’μμ κΈ°μ€)
|
367 |
+
const apiUrl = 'https://huggingface.co/api/models?sort=likes7d&direction=-1&limit=30';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
368 |
|
369 |
console.log(`π‘ API νΈμΆ μ€: ${apiUrl}`);
|
370 |
const response = await fetch(apiUrl, {
|
|
|
383 |
console.error('β API μλ¬:', error);
|
384 |
console.log('π νλ‘μ μλ²λ₯Ό ν΅ν μμ²μ μλν©λλ€...');
|
385 |
// CORS μλ¬ μ νλ‘μ μ¬μ© μλ
|
386 |
+
tryProxyRequest('models', container);
|
387 |
}
|
388 |
}
|
389 |
|
390 |
// HuggingFace Spaces λ‘λ
|
391 |
+
async function loadHFSpaces() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
392 |
const container = document.getElementById('hf-spaces-content');
|
393 |
container.innerHTML = '<div class="loading"><div class="loading-spinner"></div><p>μ€νμ΄μ€ λ‘λ© μ€...</p></div>';
|
394 |
|
395 |
try {
|
396 |
+
// HuggingFace API μ¬μ© - trending (7μΌκ° μ’μμ κΈ°μ€)
|
397 |
+
const apiUrl = 'https://huggingface.co/api/spaces?sort=likes7d&direction=-1&limit=30';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
398 |
|
399 |
console.log(`π‘ API νΈμΆ μ€: ${apiUrl}`);
|
400 |
const response = await fetch(apiUrl, {
|
|
|
413 |
console.error('β API μλ¬:', error);
|
414 |
console.log('π νλ‘μ μλ²λ₯Ό ν΅ν μμ²μ μλν©λλ€...');
|
415 |
// CORS μλ¬ μ νλ‘μ μ¬μ© μλ
|
416 |
+
tryProxyRequest('spaces', container);
|
417 |
}
|
418 |
}
|
419 |
|
420 |
// νλ‘μλ₯Ό ν΅ν μμ² μλ
|
421 |
+
async function tryProxyRequest(type, container) {
|
422 |
try {
|
423 |
console.log('π νλ‘μλ₯Ό ν΅ν μμ² μλ μ€...');
|
424 |
// κ³΅κ° CORS νλ‘μ μ¬μ© (μ: cors-anywhere)
|
|
|
426 |
let targetUrl;
|
427 |
|
428 |
if (type === 'models') {
|
429 |
+
targetUrl = 'https://huggingface.co/api/models?sort=likes7d&direction=-1&limit=30';
|
|
|
|
|
430 |
} else {
|
431 |
+
targetUrl = 'https://huggingface.co/api/spaces?sort=likes7d&direction=-1&limit=30';
|
|
|
|
|
432 |
}
|
433 |
|
434 |
console.log(`π‘ νλ‘μ URL: ${proxyUrl + encodeURIComponent(targetUrl)}`);
|
|
|
446 |
console.log('π μν λ°μ΄ν°λ₯Ό νμν©λλ€.');
|
447 |
// λͺ¨λ μλ μ€ν¨ μ μν λ°μ΄ν° νμ
|
448 |
if (type === 'models') {
|
449 |
+
displaySampleHFModels(container);
|
450 |
} else {
|
451 |
+
displaySampleHFSpaces(container);
|
452 |
}
|
453 |
}
|
454 |
}
|
455 |
|
456 |
// Replicate λͺ¨λΈ λ‘λ
|
457 |
+
async function loadReplicate(type) {
|
458 |
+
const currentType = type || 'featured';
|
459 |
+
|
460 |
+
// νν° λ²νΌ νμ±ν
|
461 |
+
document.querySelectorAll('#replicate .filter-btn').forEach(btn => {
|
462 |
+
btn.classList.remove('active');
|
463 |
+
});
|
464 |
+
if (event && event.target) {
|
465 |
+
event.target.classList.add('active');
|
466 |
+
} else {
|
467 |
+
document.querySelector('#replicate .filter-btn').classList.add('active');
|
468 |
+
}
|
469 |
+
|
470 |
+
console.log(`π Replicate ${currentType} λͺ¨λΈ λ‘λ μμ`);
|
471 |
const container = document.getElementById('replicate-content');
|
472 |
container.innerHTML = '<div class="loading"><div class="loading-spinner"></div><p>λͺ¨λΈ λ‘λ© μ€...</p></div>';
|
473 |
|
474 |
// Replicateλ κ³΅κ° APIκ° μ νμ μ΄λ―λ‘ μν λ°μ΄ν° νμ
|
475 |
+
console.log(`βΉοΈ Replicate ${currentType} λͺ¨λΈ μν λ°μ΄ν°λ₯Ό νμν©λλ€.`);
|
476 |
+
displaySampleReplicateModels(container, currentType);
|
477 |
}
|
478 |
|
479 |
// HuggingFace Models νμ
|
|
|
533 |
<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;">
|
534 |
${data.rank}
|
535 |
</div>
|
536 |
+
${data.badge ? `<div style="position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.7); color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem;">${data.badge}</div>` : ''}
|
537 |
<div class="item-header">
|
538 |
<div class="item-icon">${data.icon}</div>
|
539 |
<div class="item-info">
|
|
|
567 |
}
|
568 |
|
569 |
// μν λ°μ΄ν° νμ ν¨μλ€
|
570 |
+
function displaySampleHFModels(container) {
|
571 |
+
console.log(`π νΈλ λ© λͺ¨λΈ μν λ°μ΄ν°λ₯Ό νμν©λλ€.`);
|
572 |
+
const sampleData = [
|
573 |
{ rank: 1, title: 'Llama-3.3-70B-Instruct', author: 'meta-llama', likes: 177000, downloads: 1150000, icon: 'π€', pipeline_tag: 'text-generation', tags: ['llama', '70b', 'instruct'] },
|
574 |
{ rank: 2, title: 'DeepSeek-R1-Distill-Qwen-32B', author: 'deepseek-ai', likes: 10400, downloads: 567000, icon: 'π€', pipeline_tag: 'text-generation', tags: ['deepseek', 'reasoning'] },
|
575 |
{ rank: 3, title: 'Qwen3-235B-A22B', author: 'Qwen', likes: 5370, downloads: 225000, icon: 'π€', pipeline_tag: 'text-generation', tags: ['qwen', 'large'] },
|
|
|
580 |
{ rank: 8, title: 'MusicGen-Stereo-Melody', author: 'facebook', likes: 5430, downloads: 98000, icon: 'π€', pipeline_tag: 'text-to-audio', tags: ['music', 'generation'] },
|
581 |
{ rank: 9, title: 'Florence-2-large', author: 'microsoft', likes: 4890, downloads: 87000, icon: 'π€', pipeline_tag: 'image-text-to-text', tags: ['vision', 'florence'] },
|
582 |
{ rank: 10, title: 'QwQ-32B-Preview', author: 'Qwen', likes: 4560, downloads: 76000, icon: 'π€', pipeline_tag: 'text-generation', tags: ['reasoning', 'cot'] }
|
|
|
|
|
|
|
|
|
|
|
|
|
583 |
];
|
584 |
|
585 |
container.innerHTML = '';
|
|
|
589 |
});
|
590 |
}
|
591 |
|
592 |
+
function displaySampleHFSpaces(container) {
|
593 |
+
console.log(`π νΈλ λ© μ€νμ΄μ€ μν λ°μ΄ν°λ₯Ό νμν©λλ€.`);
|
594 |
+
const sampleData = [
|
595 |
{ rank: 1, title: 'stable-diffusion-webui', author: 'stabilityai', likes: 75500, sdk: 'Gradio', icon: 'π¨', hardware: 'T4 GPU' },
|
596 |
{ rank: 2, title: 'chatgpt-clone', author: 'community', likes: 12300, sdk: 'Streamlit', icon: 'π¬', hardware: 'CPU' },
|
597 |
{ rank: 3, title: 'InstantID', author: 'InstantX', likes: 8590, sdk: 'Gradio', icon: 'π€', hardware: 'A10G' },
|
|
|
602 |
{ rank: 8, title: 'pdf-chatbot', author: 'doc-ai', likes: 1980, sdk: 'Gradio', icon: 'π', hardware: 'T4 GPU' },
|
603 |
{ rank: 9, title: 'anime-art-generator', author: 'waifu-ai', likes: 1670, sdk: 'Gradio', icon: 'π', hardware: 'T4 GPU' },
|
604 |
{ rank: 10, title: 'dataset-explorer', author: 'data-tools', likes: 1450, sdk: 'Streamlit', icon: 'π', hardware: 'CPU' }
|
|
|
|
|
|
|
|
|
|
|
|
|
605 |
];
|
606 |
|
607 |
container.innerHTML = '';
|
|
|
611 |
});
|
612 |
}
|
613 |
|
614 |
+
function displaySampleReplicateModels(container, type) {
|
615 |
+
console.log(`π Replicate ${type} λͺ¨λΈ μν λ°μ΄ν°λ₯Ό νμν©λλ€.`);
|
616 |
+
|
617 |
+
const featuredData = [
|
618 |
+
{ rank: 1, title: 'flux-1.1-pro', author: 'black-forest-labs', runs: 2910000, icon: 'π¨', badge: 'β Featured' },
|
619 |
+
{ rank: 2, title: 'llama-3.3-70b-versatile', author: 'meta', runs: 1850000, icon: 'π€', badge: 'β Featured' },
|
620 |
+
{ rank: 3, title: 'stable-video-diffusion', author: 'stability-ai', runs: 890000, icon: 'π¬', badge: 'β Featured' },
|
621 |
+
{ rank: 4, title: 'whisper-large-v3-turbo', author: 'openai', runs: 670000, icon: 'π€', badge: 'β Featured' },
|
622 |
+
{ rank: 5, title: 'musicgen-stereo-large', author: 'facebook', runs: 450000, icon: 'π΅', badge: 'β Featured' },
|
623 |
+
{ rank: 6, title: 'animate-lcm', author: 'lucataco', runs: 320000, icon: 'β¨', badge: 'β Featured' },
|
624 |
+
{ rank: 7, title: 'instant-id', author: 'zsxkib', runs: 280000, icon: 'π€', badge: 'β Featured' },
|
625 |
+
{ rank: 8, title: 'face-restoration', author: 'tencentarc', runs: 210000, icon: 'β¨', badge: 'β Featured' }
|
626 |
+
];
|
627 |
+
|
628 |
+
const officialData = [
|
629 |
+
{ rank: 1, title: 'meta-llama-3.3-70b-instruct', author: 'meta', runs: 3450000, icon: 'π€', badge: 'β
Official' },
|
630 |
+
{ rank: 2, title: 'flux-1.1-pro', author: 'black-forest-labs', runs: 2910000, icon: 'π¨', badge: 'β
Official' },
|
631 |
+
{ rank: 3, title: 'stable-diffusion-3', author: 'stability-ai', runs: 1750000, icon: 'πΌοΈ', badge: 'β
Official' },
|
632 |
+
{ rank: 4, title: 'whisper', author: 'openai', runs: 890000, icon: 'π€', badge: 'β
Official' },
|
633 |
+
{ rank: 5, title: 'musicgen', author: 'facebook', runs: 450000, icon: 'π΅', badge: 'β
Official' },
|
634 |
+
{ rank: 6, title: 'sdxl', author: 'stability-ai', runs: 380000, icon: 'π¨', badge: 'β
Official' },
|
635 |
+
{ rank: 7, title: 'claude-3.7-sonnet', author: 'anthropic', runs: 290000, icon: 'π€', badge: 'β
Official' },
|
636 |
+
{ rank: 8, title: 'gemma-2-9b-it', author: 'google', runs: 180000, icon: 'π¬', badge: 'β
Official' }
|
637 |
];
|
638 |
|
639 |
+
const sampleData = type === 'official' ? officialData : featuredData;
|
640 |
+
|
641 |
container.innerHTML = '';
|
642 |
sampleData.forEach(model => {
|
643 |
model.url = `https://replicate.com/${model.author}/${model.title}`;
|
|
|
648 |
// μλ‘κ³ μΉ¨
|
649 |
function refreshCurrent() {
|
650 |
if (currentCategory === 'hf-models') {
|
651 |
+
loadHFModels();
|
652 |
} else if (currentCategory === 'hf-spaces') {
|
653 |
+
loadHFSpaces();
|
654 |
} else {
|
655 |
+
const activeBtn = document.querySelector('#replicate .filter-btn.active');
|
656 |
+
const type = activeBtn.textContent.includes('Featured') ? 'featured' : 'official';
|
657 |
+
loadReplicate(type);
|
658 |
}
|
659 |
}
|
660 |
|
|
|
663 |
console.log('π HuggingFace & Replicate νΈλ λ© λ¦¬μ€νΈ λ‘λ μμ');
|
664 |
console.log('π API Endpoints:');
|
665 |
console.log('- HF Models (Trending): https://huggingface.co/api/models?sort=likes7d&direction=-1&limit=30');
|
666 |
+
console.log('- HF Spaces (Trending): https://huggingface.co/api/spaces?sort=likes7d&direction=-1&limit=30');
|
|
|
|
|
667 |
|
668 |
+
loadHFModels();
|
669 |
});
|
670 |
</script>
|
671 |
</body>
|