Skip to content

The open-source AI voice studio. Clone, dictate, create.

Fix migration dialog hanging when no models are present (#439)

高巨龙abd994343036
diff --git a/backend/routes/models.py b/backend/routes/models.py
index d9ee1e8f..7cbb7b04 100644
--- a/backend/routes/models.py
+++ b/backend/routes/models.py
@@ -135,14 +135,15 @@ async def migrate_models(request: models.ModelMigrateRequest):
if destination.resolve().is_relative_to(source.resolve()):
raise HTTPException(status_code=400, detail="Destination cannot be inside the current cache directory")
+ progress_manager = get_progress_manager()
model_dirs = [d for d in source.iterdir() if d.name.startswith("models--") and d.is_dir()]
if not model_dirs:
+ progress_manager.update_progress("migration", 1, 1, status="complete")
+ progress_manager.mark_complete("migration")
return {"moved": 0, "errors": [], "source": str(source), "destination": str(destination)}
destination.mkdir(parents=True, exist_ok=True)
- progress_manager = get_progress_manager()
-
same_fs = False
try:
same_fs = source.stat().st_dev == destination.stat().st_dev