support direct loading of .safetensors models

- Small fix to allow ckpt files with the .safetensors suffix
  to be directly loaded, rather than undergo a conversion step
  first.
This commit is contained in:
Lincoln Stein 2023-01-17 08:11:19 -05:00
parent 8a31e5c5e3
commit fc2098834d

View File

@ -142,7 +142,7 @@ class ModelManager(object):
Return true if this is a legacy (.ckpt) model
'''
info = self.model_info(model_name)
if 'weights' in info and info['weights'].endswith('.ckpt'):
if 'weights' in info and info['weights'].endswith(('.ckpt','.safetensors')):
return True
return False