Minor bug fix

This commit is contained in:
oobabooga 2023-05-17 11:16:37 -03:00
parent 1a8151a2b6
commit fb91c07191
2 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,7 @@ def load_quantized(model_name):
found_pts = list(path_to_model.glob("*.pt")) found_pts = list(path_to_model.glob("*.pt"))
found_safetensors = list(path_to_model.glob("*.safetensors")) found_safetensors = list(path_to_model.glob("*.safetensors"))
if len(found_safetensors) > 0: if len(found_safetensors) > 0:
if len(found_pts) > 1: if len(found_safetensors) > 1:
logging.warning('More than one .safetensors model has been found. The last one will be selected. It could be wrong.') logging.warning('More than one .safetensors model has been found. The last one will be selected. It could be wrong.')
use_safetensors = True use_safetensors = True

View file

@ -133,7 +133,7 @@ def find_quantized_model_file(model_name):
pt_path = found_pts[-1] pt_path = found_pts[-1]
elif len(found_safetensors) > 0: elif len(found_safetensors) > 0:
if len(found_pts) > 1: if len(found_safetensors) > 1:
logging.warning('More than one .safetensors model has been found. The last one will be selected. It could be wrong.') logging.warning('More than one .safetensors model has been found. The last one will be selected. It could be wrong.')
pt_path = found_safetensors[-1] pt_path = found_safetensors[-1]