Guard llama.cpp GGUF website links (#3349)

Co-authored-by: LauraGPT <[email protected]>
This commit is contained in:
zhifu gao
2026-07-23 04:07:45 +08:00
committed by GitHub
co-authored by LauraGPT
parent 061881aa74
commit f4327e8b23
2 changed files with 26 additions and 0 deletions
+12
View File
@@ -54,10 +54,21 @@ PAGE_CONTRACTS: dict[str, PageContract] = {
required=("recommended funasr &gt;= 1.3.26", "/en/donors.html"),
forbidden=("1.3.10",),
),
f"{BASE_URL}/llama-cpp.html": PageContract(
required=(
"runtime-llamacpp-v0.1.8",
"funasr-llamacpp-linux-x64-vulkan.tar.gz",
"funasr-llamacpp-windows-x64-cuda.zip",
"Fun-ASR-Nano",
"GGUF",
),
forbidden=("runtime-llamacpp-v0.1.1",),
),
f"{BASE_URL}/blog/funasr-llama-cpp-whisper-cpp-alternative.html": PageContract(
required=(
"runtime-llamacpp-v0.1.8",
"funasr-llamacpp-linux-x64-vulkan.tar.gz",
"Fun-ASR-Nano-GGUF",
"Vulkan / CUDA",
"/donors.html",
),
@@ -67,6 +78,7 @@ PAGE_CONTRACTS: dict[str, PageContract] = {
required=(
"runtime-llamacpp-v0.1.8",
"funasr-llamacpp-linux-x64-vulkan.tar.gz",
"Fun-ASR-Nano-GGUF",
"Vulkan / CUDA",
"/en/donors.html",
),
+14
View File
@@ -48,15 +48,24 @@ def test_website_contract_accepts_current_public_copy():
pip install -U funasr # recommended funasr &gt;= 1.3.26
<a href="/en/donors.html">Thanks</a>
""",
"https://www.funasr.com/llama-cpp.html": """
runtime-llamacpp-v0.1.8
funasr-llamacpp-linux-x64-vulkan.tar.gz
funasr-llamacpp-windows-x64-cuda.zip
Fun-ASR-Nano
GGUF
""",
"https://www.funasr.com/blog/funasr-llama-cpp-whisper-cpp-alternative.html": """
runtime-llamacpp-v0.1.8
funasr-llamacpp-linux-x64-vulkan.tar.gz
Fun-ASR-Nano-GGUF
Vulkan / CUDA
<a href="/donors.html">功德榜</a>
""",
"https://www.funasr.com/en/blog/funasr-llama-cpp-whisper-cpp-alternative.html": """
runtime-llamacpp-v0.1.8
funasr-llamacpp-linux-x64-vulkan.tar.gz
Fun-ASR-Nano-GGUF
Vulkan / CUDA
<a href="/en/donors.html">Thanks</a>
""",
@@ -75,6 +84,7 @@ def test_website_contract_reports_stale_runtime_and_star_copy():
pages[
"https://www.funasr.com/blog/funasr-llama-cpp-whisper-cpp-alternative.html"
] = "runtime-llamacpp-v0.1.1"
pages["https://www.funasr.com/llama-cpp.html"] = "runtime-llamacpp-v0.1.1"
failures = checker.validate_pages(pages)
@@ -84,6 +94,10 @@ def test_website_contract_reports_stale_runtime_and_star_copy():
and "forbidden `runtime-llamacpp-v0.1.1`" in failure
for failure in failures
)
assert any(
"llama-cpp.html" in failure and "forbidden `runtime-llamacpp-v0.1.1`" in failure
for failure in failures
)
def test_fetch_pages_retries_transient_url_errors(monkeypatch):