Some checks failed
Windows / verify (push) Has been cancelled
Systran/faster-whisper-large-v3-turbo 는 Hugging Face 에 없는 저장소라 번역 시작 시 401 Repository Not Found 로 바로 실패했다. faster-whisper 가 'turbo' 로 공식 매핑하는 저장소 (mobiuslabsgmbh → 현재 dropbox-dash/faster-whisper-large-v3-turbo)로 바꾼다. 티어의 모든 ASR/MT 저장소가 로그인 없이 공개돼 있고 가중치가 있는지 확인하는 테스트를 추가했다 (오프라인이면 건너뜀). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
"""티어에 적힌 Hugging Face 저장소가 실제로 로그인 없이 받아지는지 확인한다.
|
|
|
|
저장소 이름이 틀리면 사용자 PC에서 "번역 시작"을 누를 때 401/404 로 처음 드러난다.
|
|
(v0.3.0-test4: 존재하지 않는 Systran/faster-whisper-large-v3-turbo 를 가리키고 있었다.)
|
|
네트워크가 없으면 건너뛴다.
|
|
"""
|
|
|
|
import pytest
|
|
|
|
from livesub.models.tiers import TIERS
|
|
|
|
huggingface_hub = pytest.importorskip("huggingface_hub")
|
|
|
|
|
|
def _repos() -> list[str]:
|
|
return sorted({r for t in TIERS.values() for r in (t.asr.repo, t.mt.repo)})
|
|
|
|
|
|
def _online() -> bool:
|
|
try:
|
|
huggingface_hub.HfApi().model_info("Systran/faster-whisper-small", token=False)
|
|
except Exception:
|
|
return False
|
|
return True
|
|
|
|
|
|
@pytest.mark.parametrize("repo", _repos())
|
|
def test_repo_is_public_and_has_weights(repo):
|
|
if not _online():
|
|
pytest.skip("Hugging Face 에 접속할 수 없음")
|
|
info = huggingface_hub.HfApi().model_info(repo, token=False)
|
|
assert not info.private
|
|
assert not info.gated
|
|
files = {s.rfilename for s in info.siblings}
|
|
assert files & {"model.bin", "model.safetensors"} or any(
|
|
f.endswith(".safetensors") for f in files
|
|
), f"{repo}: 가중치 파일이 없음 ({sorted(files)})"
|