feat: auto set default root paths for loras, checkpoints, and embeddings in settings

This commit is contained in:
Will Miao
2025-07-30 10:08:21 +08:00
parent 32f42bafaa
commit 82a068e610
2 changed files with 26 additions and 0 deletions

View File

@@ -59,6 +59,9 @@ class Config:
if self.checkpoints_roots and len(self.checkpoints_roots) == 1 and "default_checkpoint_root" not in settings:
settings["default_checkpoint_root"] = self.checkpoints_roots[0]
if self.embeddings_roots and len(self.embeddings_roots) == 1 and "default_embedding_root" not in settings:
settings["default_embedding_root"] = self.embeddings_roots[0]
# Save settings
with open(settings_path, 'w', encoding='utf-8') as f: