mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-10-03 17:15:19 -07:00
fix(cache): share the orphaned-.incomplete check with /models/status
This commit is contained in:
committed by
capy-ai-staging[bot]
parent
f62aff0809
commit
e86a2dcaa5
@@ -244,6 +244,7 @@ async def get_model_status():
|
||||
use_scan_cache = False
|
||||
|
||||
from ..backends import get_all_model_configs, check_model_loaded
|
||||
from ..backends.base import has_in_progress_download
|
||||
|
||||
registry_configs = get_all_model_configs()
|
||||
model_configs = [
|
||||
@@ -293,8 +294,7 @@ async def get_model_status():
|
||||
try:
|
||||
cache_dir = hf_constants.HF_HUB_CACHE
|
||||
blobs_dir = Path(cache_dir) / ("models--" + repo_id.replace("/", "--")) / "blobs"
|
||||
if blobs_dir.exists():
|
||||
has_incomplete = any(blobs_dir.glob("*.incomplete"))
|
||||
has_incomplete = has_in_progress_download(blobs_dir)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
@@ -314,7 +314,7 @@ async def get_model_status():
|
||||
|
||||
if repo_cache.exists():
|
||||
blobs_dir = repo_cache / "blobs"
|
||||
has_incomplete = blobs_dir.exists() and any(blobs_dir.glob("*.incomplete"))
|
||||
has_incomplete = has_in_progress_download(blobs_dir)
|
||||
|
||||
if not has_incomplete:
|
||||
snapshots_dir = repo_cache / "snapshots"
|
||||
|
||||
Reference in New Issue
Block a user