mirror of
https://github.com/invoke-ai/InvokeAI
synced 2026-04-26 16:52:08 +02:00
Fix error message when adding a local path with quotes around the string
This commit is contained in:
parent
174ea021a6
commit
6fc6be3aa0
@ -438,9 +438,10 @@ class ModelInstallService(ModelInstallServiceBase):
|
||||
variants = "|".join(ModelRepoVariant.__members__.values())
|
||||
hf_repoid_re = f"^([^/:]+/[^/:]+)(?::({variants})?(?::/?([^:]+))?)?$"
|
||||
source_obj: Optional[StringLikeSource] = None
|
||||
source_stripped = source.strip('\"') # Strip possible quotes from source string to avoid later errors with local files or directories
|
||||
|
||||
if Path(source).exists(): # A local file or directory
|
||||
source_obj = LocalModelSource(path=Path(source))
|
||||
if Path(source_stripped).exists(): # A local file or directory
|
||||
source_obj = LocalModelSource(path=Path(source_stripped))
|
||||
elif match := re.match(hf_repoid_re, source):
|
||||
source_obj = HFModelSource(
|
||||
repo_id=match.group(1),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user