Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions backend/services/asr_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3109,16 +3109,16 @@ def _licence_repo(name: str | None, *, faster_whisper: bool = False) -> str | No

A local directory outside the HF cache has no registry identity (it is a
user-provided asset) and yields None. Local paths are recognised by syntax
(absolute, ``./``, ``../``, ``~``, drive letters), never by probing the
filesystem with a user-provided name.
(absolute, a leading separator, ``./``, ``../``, ``~``, drive letters),
never by probing the filesystem with a user-provided name.
"""
name = str(name or "").strip()
if not name:
return None
cached = _HF_CACHE_DIR.search(name)
if cached:
return f"{cached.group(1)}/{cached.group(2)}"
if os.path.isabs(name) or name.startswith((".", "~")) or "\\" in name or _DRIVE_PATH.match(name):
if os.path.isabs(name) or name.startswith(("/", ".", "~")) or "\\" in name or _DRIVE_PATH.match(name):
return None
if name.lower() in _MOONSHINE_REPOS:
return _MOONSHINE_REPOS[name.lower()]
Expand Down