fix autoimport crash

This commit is contained in:
Lincoln Stein 2023-07-05 21:53:08 -04:00
parent cfa3b2419c
commit 3691b55565

View File

@ -225,7 +225,7 @@ class ModelInstall(object):
if not info:
logger.warning(f'Unable to parse format of {path}')
return None
model_name = path.stem if info.format == "checkpoint" else path.name
model_name = path.stem if path.is_file() else path.name
if self.mgr.model_exists(model_name, info.base_type, info.model_type):
raise ValueError(f'A model named "{model_name}" is already installed.')
attributes = self._make_attributes(path,info)