mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
allow deletion of symlinked models in models dir
This commit is contained in:
parent
37fd57d4d9
commit
0f02a72cb9
@ -390,10 +390,10 @@ class ModelInstallService(ModelInstallServiceBase):
|
|||||||
def unconditionally_delete(self, key: str) -> None: # noqa D102
|
def unconditionally_delete(self, key: str) -> None: # noqa D102
|
||||||
model = self.record_store.get_model(key)
|
model = self.record_store.get_model(key)
|
||||||
model_path = self.app_config.models_path / model.path
|
model_path = self.app_config.models_path / model.path
|
||||||
if model_path.is_dir():
|
if model_path.is_file() or model_path.is_symlink():
|
||||||
rmtree(model_path)
|
|
||||||
else:
|
|
||||||
model_path.unlink()
|
model_path.unlink()
|
||||||
|
elif model_path.is_dir():
|
||||||
|
rmtree(model_path)
|
||||||
self.unregister(key)
|
self.unregister(key)
|
||||||
|
|
||||||
def download_and_cache(
|
def download_and_cache(
|
||||||
|
Loading…
Reference in New Issue
Block a user