{ // 获取包含Hugging Face文本的span元素 const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap'); spans.forEach(span => { if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) { span.textContent = 'AI快站'; } }); }); // 替换logo图片的alt属性 document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => { if (img.alt.match(/Hugging\s*Face/i)) { img.alt = 'AI快站 logo'; } }); } // 替换导航栏中的链接 function replaceNavigationLinks() { // 已替换标记,防止重复运行 if (window._navLinksReplaced) { return; } // 已经替换过的链接集合,防止重复替换 const replacedLinks = new Set(); // 只在导航栏区域查找和替换链接 const headerArea = document.querySelector('header') || document.querySelector('nav'); if (!headerArea) { return; } // 在导航区域内查找链接 const navLinks = headerArea.querySelectorAll('a'); navLinks.forEach(link => { // 如果已经替换过,跳过 if (replacedLinks.has(link)) return; const linkText = link.textContent.trim(); const linkHref = link.getAttribute('href') || ''; // 替换Spaces链接 - 仅替换一次 if ( (linkHref.includes('/spaces') || linkHref === '/spaces' || linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) && linkText !== 'OCR模型免费转Markdown' && linkText !== 'OCR模型免费转Markdown' ) { link.textContent = 'OCR模型免费转Markdown'; link.href = 'https://fast360.xyz'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); replacedLinks.add(link); } // 删除Posts链接 else if ( (linkHref.includes('/posts') || linkHref === '/posts' || linkText === 'Posts' || linkText.match(/^s*Postss*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } // 替换Docs链接 - 仅替换一次 else if ( (linkHref.includes('/docs') || linkHref === '/docs' || linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) && linkText !== '模型下载攻略' ) { link.textContent = '模型下载攻略'; link.href = '/'; replacedLinks.add(link); } // 删除Enterprise链接 else if ( (linkHref.includes('/enterprise') || linkHref === '/enterprise' || linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } }); // 查找可能嵌套的Spaces和Posts文本 const textNodes = []; function findTextNodes(element) { if (element.nodeType === Node.TEXT_NODE) { const text = element.textContent.trim(); if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') { textNodes.push(element); } } else { for (const child of element.childNodes) { findTextNodes(child); } } } // 只在导航区域内查找文本节点 findTextNodes(headerArea); // 替换找到的文本节点 textNodes.forEach(node => { const text = node.textContent.trim(); if (text === 'Spaces') { node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown'); } else if (text === 'Posts') { // 删除Posts文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } else if (text === 'Enterprise') { // 删除Enterprise文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } }); // 标记已替换完成 window._navLinksReplaced = true; } // 替换代码区域中的域名 function replaceCodeDomains() { // 特别处理span.hljs-string和span.njs-string元素 document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换hljs-string类的span中的域名(移除多余的转义符号) document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换pre和code标签中包含git clone命令的域名 document.querySelectorAll('pre, code').forEach(element => { if (element.textContent && element.textContent.includes('git clone')) { const text = element.innerHTML; if (text.includes('huggingface.co')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 处理特定的命令行示例 document.querySelectorAll('pre, code').forEach(element => { const text = element.innerHTML; if (text.includes('huggingface.co')) { // 针对git clone命令的专门处理 if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 特别处理模型下载页面上的代码片段 document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => { const content = container.innerHTML; if (content && content.includes('huggingface.co')) { container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 特别处理模型仓库克隆对话框中的代码片段 try { // 查找包含"Clone this model repository"标题的对话框 const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]'); if (cloneDialog) { // 查找对话框中所有的代码片段和命令示例 const codeElements = cloneDialog.querySelectorAll('pre, code, span'); codeElements.forEach(element => { if (element.textContent && element.textContent.includes('huggingface.co')) { if (element.innerHTML.includes('huggingface.co')) { element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); } // 更精确地定位克隆命令中的域名 document.querySelectorAll('[data-target]').forEach(container => { const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string'); codeBlocks.forEach(block => { if (block.textContent && block.textContent.includes('huggingface.co')) { if (block.innerHTML.includes('huggingface.co')) { block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); }); } catch (e) { // 错误处理但不打印日志 } } // 当DOM加载完成后执行替换 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); }); } else { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); } // 增加一个MutationObserver来处理可能的动态元素加载 const observer = new MutationObserver(mutations => { // 检查是否导航区域有变化 const hasNavChanges = mutations.some(mutation => { // 检查是否存在header或nav元素变化 return Array.from(mutation.addedNodes).some(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查是否是导航元素或其子元素 if (node.tagName === 'HEADER' || node.tagName === 'NAV' || node.querySelector('header, nav')) { return true; } // 检查是否在导航元素内部 let parent = node.parentElement; while (parent) { if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') { return true; } parent = parent.parentElement; } } return false; }); }); // 只在导航区域有变化时执行替换 if (hasNavChanges) { // 重置替换状态,允许再次替换 window._navLinksReplaced = false; replaceHeaderBranding(); replaceNavigationLinks(); } }); // 开始观察document.body的变化,包括子节点 if (document.body) { observer.observe(document.body, { childList: true, subtree: true }); } else { document.addEventListener('DOMContentLoaded', () => { observer.observe(document.body, { childList: true, subtree: true }); }); } })(); \\n'\n\n","replicas":{"requested":1},"devMode":false,"domains":[{"domain":"dibt-russian-mpep-dashboard.hf.space","stage":"READY"}]},"title":"🇷🇺 Russian - Multilingual Prompt Evaluation Project","isLikedByUser":false,"trendingScore":0,"tags":["gradio","region:us"],"type":"space","position":4,"_id":"65fe67f25c6c7162e4374fe3"},{"author":"open-llm-leaderboard","authorData":{"_id":"649070e345920777b9f1f5c1","avatarUrl":"https://aifasthub.com/avatars/v1/production/uploads/5df7e9e5da6d0311fd3d53f9/j21QZzv9_PGPUH5FbUaeM.png","fullname":"Open LLM Leaderboard","name":"open-llm-leaderboard","type":"org","isHf":false,"isHfAdmin":false,"isMod":false,"isEnterprise":true,"followerCount":1314},"colorFrom":"blue","colorTo":"red","createdAt":"2023-04-17T11:40:06.000Z","emoji":"🏆","id":"open-llm-leaderboard/open_llm_leaderboard","lastModified":"2025-03-25T09:02:15.000Z","likes":13447,"pinned":true,"private":false,"sdk":"docker","repoType":"space","runtime":{"stage":"RUNNING","hardware":{"current":"cpu-upgrade","requested":"cpu-upgrade"},"storage":"small","gcTimeout":172800,"replicas":{"current":1,"requested":1},"devMode":false,"domains":[{"domain":"open-llm-leaderboard-open-llm-leaderboard.hf.space","stage":"READY"}],"sha":"6ee9164f8a40124224ffd0ca2be9d859f048dacb"},"shortDescription":"Track, rank and evaluate open LLMs and chatbots","title":"Open LLM Leaderboard","isLikedByUser":false,"ai_short_description":"Compare open-source LLMs across benchmarks","ai_category":"Text Analysis","trendingScore":28,"tags":["docker","leaderboard","modality:text","submission:automatic","test:public","language:english","eval:code","eval:math","region:us"],"type":"space","position":5,"_id":"668394bf56c9db99812b2025"},{"author":"plan-com-ai","authorData":{"_id":"656ea4881677b468ff707ff3","avatarUrl":"https://aifasthub.com/avatars/v1/production/uploads/656ea4524f4459da31cf66aa/eZ_EIlg5l_9KzLb7-seEU.png","fullname":"Plan Communications","name":"plan-com-ai","type":"org","isHf":false,"isHfAdmin":false,"isMod":false,"isEnterprise":false,"followerCount":6},"colorFrom":"gray","colorTo":"gray","createdAt":"2024-08-01T03:56:05.000Z","emoji":"💬","id":"plan-com-ai/Athena720","lastModified":"2024-08-01T19:55:21.000Z","likes":1,"pinned":false,"private":false,"sdk":"gradio","repoType":"space","runtime":{"stage":"SLEEPING","hardware":{"current":null,"requested":"cpu-basic"},"storage":null,"gcTimeout":172800,"errorMessage":null,"replicas":{"requested":1},"devMode":false,"domains":[{"domain":"plan-com-ai-athena720.hf.space","stage":"READY"}]},"title":"Athena720","isLikedByUser":false,"trendingScore":0,"tags":["gradio","region:us"],"type":"space","position":6,"_id":"66abe863276b95c444d79e96"},{"author":"webml-community","authorData":{"_id":"65ef8f2d9540f72aff05a3c4","avatarUrl":"https://aifasthub.com/avatars/v1/production/uploads/61b253b7ac5ecaae3d1efe0c/UJbVX1QgBUe21A8nm5zWL.png","fullname":"WebML Community","name":"webml-community","type":"org","isHf":false,"isHfAdmin":false,"isMod":false,"isEnterprise":false,"followerCount":617},"colorFrom":"yellow","colorTo":"gray","createdAt":"2025-01-27T22:48:24.000Z","emoji":"🏛️","id":"webml-community/janus-pro-webgpu","lastModified":"2025-01-27T23:11:42.000Z","likes":214,"pinned":false,"private":false,"sdk":"static","repoType":"space","runtime":{"stage":"RUNNING","hardware":{"current":null,"requested":null},"storage":null,"replicas":{"requested":1,"current":1}},"shortDescription":"In-browser unified multimodal understanding and generation.","title":"Janus Pro WebGPU","isLikedByUser":false,"ai_short_description":"Render complex mathematical equations on web pages","ai_category":"Text Generation","trendingScore":0,"tags":["static","region:us"],"type":"space","position":8,"_id":"6798a83e582fda525af494ec"},{"author":"Wan-AI","authorData":{"_id":"67bc7cd418dd753c02a82684","avatarUrl":"https://aifasthub.com/avatars/v1/production/uploads/67b610677ea7952def8b29c6/N6jQbbeaa_FcUY-wI1dgG.png","fullname":"Wan-AI","name":"Wan-AI","type":"org","isHf":false,"isHfAdmin":false,"isMod":false,"isEnterprise":false,"followerCount":3835},"colorFrom":"indigo","colorTo":"indigo","createdAt":"2025-02-23T09:50:52.000Z","emoji":"💻","id":"Wan-AI/Wan2.1","lastModified":"2025-03-20T12:20:36.000Z","likes":1808,"pinned":false,"private":false,"sdk":"gradio","repoType":"space","runtime":{"stage":"RUNTIME_ERROR","hardware":{"current":null,"requested":"cpu-basic"},"storage":null,"gcTimeout":172800,"errorMessage":"Exit code: 1. Reason: opy(app.get_blocks().get_api_info())\n File \"/usr/local/lib/python3.10/site-packages/gradio/blocks.py\", line 3046, in get_api_info\n python_type = client_utils.json_schema_to_python_type(info)\n File \"/usr/local/lib/python3.10/site-packages/gradio_client/utils.py\", line 931, in json_schema_to_python_type\n type_ = _json_schema_to_python_type(schema, schema.get(\"$defs\"))\n File \"/usr/local/lib/python3.10/site-packages/gradio_client/utils.py\", line 985, in _json_schema_to_python_type\n des = [\n File \"/usr/local/lib/python3.10/site-packages/gradio_client/utils.py\", line 986, in \n f\"{n}: {_json_schema_to_python_type(v, defs)}{get_desc(v)}\"\n File \"/usr/local/lib/python3.10/site-packages/gradio_client/utils.py\", line 946, in _json_schema_to_python_type\n return _json_schema_to_python_type(defs[schema[\"$ref\"].split(\"/\")[-1]], defs)\n File \"/usr/local/lib/python3.10/site-packages/gradio_client/utils.py\", line 985, in _json_schema_to_python_type\n des = [\n File \"/usr/local/lib/python3.10/site-packages/gradio_client/utils.py\", line 986, in \n f\"{n}: {_json_schema_to_python_type(v, defs)}{get_desc(v)}\"\n File \"/usr/local/lib/python3.10/site-packages/gradio_client/utils.py\", line 993, in _json_schema_to_python_type\n f\"str, {_json_schema_to_python_type(schema['additionalProperties'], defs)}\"\n File \"/usr/local/lib/python3.10/site-packages/gradio_client/utils.py\", line 939, in _json_schema_to_python_type\n type_ = get_type(schema)\n File \"/usr/local/lib/python3.10/site-packages/gradio_client/utils.py\", line 898, in get_type\n if \"const\" in schema:\nTypeError: argument of type 'bool' is not iterable\nTraceback (most recent call last):\n File \"/home/user/app/app.py\", line 395, in \n demo.launch(ssr_mode=False)\n File \"/usr/local/lib/python3.10/site-packages/gradio/blocks.py\", line 2674, in launch\n raise ValueError(\nValueError: When localhost is not accessible, a shareable link must be created. Please set share=True or check your proxy settings to allow access to localhost.\n","replicas":{"requested":1},"devMode":false,"domains":[{"domain":"wanx-ai-wanx2-1.hf.space","stage":"READY"},{"domain":"wan-ai-wan2-1.hf.space","stage":"READY"}]},"shortDescription":"Wan: Open and Advanced Large-Scale Video Generative Models","title":"Wan2.1","isLikedByUser":false,"ai_short_description":"Generate videos from text or images","ai_category":"Video Generation","trendingScore":0,"tags":["gradio","region:us"],"type":"space","position":9,"_id":"67c4abdea3470cd05fed3980"},{"author":"enzostvs","authorData":{"_id":"64f73f25098581ab15e2f5ad","avatarUrl":"https://aifasthub.com/avatars/v1/production/uploads/64f73f25098581ab15e2f5ad/AS_12M3i4S4YyHv-hbuGe.png","fullname":"enzo","name":"enzostvs","type":"user","isPro":true,"isHf":true,"isHfAdmin":false,"isMod":false,"followerCount":2679},"colorFrom":"blue","colorTo":"blue","createdAt":"2025-03-26T19:26:05.000Z","emoji":"🐳","id":"enzostvs/deepsite","lastModified":"2025-07-25T16:06:47.000Z","likes":12101,"pinned":true,"private":false,"sdk":"docker","repoType":"space","runtime":{"stage":"RUNNING","hardware":{"current":"cpu-basic","requested":"cpu-basic"},"storage":null,"gcTimeout":172800,"replicas":{"current":1,"requested":1},"devMode":false,"domains":[{"domain":"enzostvs-space-generator.hf.space","stage":"READY"},{"domain":"enzostvs-deepsite.hf.space","stage":"READY"},{"domain":"deepsite.hf.co","stage":"READY"}],"sha":"8e7d8ea9f6eeeb71b649f112c9124eacec7cd14b"},"shortDescription":"Generate any application with DeepSeek","title":"DeepSite v2","isLikedByUser":false,"ai_short_description":"Build websites with AI, no code needed","ai_category":"Web Development","trendingScore":339,"tags":["docker","region:us"],"type":"space","position":10,"_id":"67f6de04bf42bfe8f8cf7f98"},{"author":"Qwen","authorData":{"_id":"64c8b5837fe12ecd0a7e92eb","avatarUrl":"https://aifasthub.com/avatars/v1/production/uploads/620760a26e3b7210c2ff1943/-s1gyJfvbE1RgO5iBeNOi.png","fullname":"Qwen","name":"Qwen","type":"org","isHf":false,"isHfAdmin":false,"isMod":false,"isEnterprise":true,"followerCount":45175},"colorFrom":"yellow","colorTo":"green","createdAt":"2025-08-03T22:25:46.000Z","emoji":"🖼️","id":"Qwen/Qwen-Image","lastModified":"2025-08-05T07:47:36.000Z","likes":680,"pinned":false,"private":false,"sdk":"gradio","repoType":"space","runtime":{"stage":"RUNNING","hardware":{"current":"zero-a10g","requested":"zero-a10g"},"storage":null,"gcTimeout":172800,"replicas":{"current":2,"requested":"auto"},"devMode":false,"domains":[{"domain":"multimodalart-qwen-image.hf.space","stage":"READY"},{"domain":"qwen-qwen-image.hf.space","stage":"READY"}],"sha":"afa2559ff29b4daeffb44cf90027f6a77272bbff"},"title":"Qwen Image","isLikedByUser":false,"ai_short_description":"Generate images from text prompts","ai_category":"Image Generation","trendingScore":153,"tags":["gradio","region:us"],"type":"space","position":11,"_id":"689eeb638d6691a5f043cc22"}],"position":1,"theme":"purple","private":false,"shareUrl":"https://huggingface.co/collections/ZennyKenny/cool-spaces-65dee3c233e96948cb10bbff","upvotes":1,"isUpvotedByUser":false},"collections":[{"title":"Cool Models","slug":"ZennyKenny/cool-models-65bf3cfc83142aa61307f182"},{"title":"Cool Spaces","slug":"ZennyKenny/cool-spaces-65dee3c233e96948cb10bbff"},{"title":"Cool Datasets","slug":"ZennyKenny/cool-datasets-664e017b9662c3dbf4282629"}],"upvoters":[{"_id":"6787f6033d342e4cc8d8c6cc","avatarUrl":"https://aifasthub.com/avatars/v1/production/uploads/noauth/BapzHmY4xylemybaIjAEn.jpeg","isPro":true,"fullname":"Joseph Robert Turcotte","user":"Fishtiks","type":"user"}],"allowGatingGroupFeature":false}">