Skip to content
Python

added ovi fastwan finetune

deepbeepmeep1b15d23ede97
diff --git a/wgp.py b/wgp.py
index d556f6b..f3b5e13 100644
--- a/wgp.py
+++ b/wgp.py
@@ -2746,7 +2746,7 @@ def save_model(model, model_type, dtype, config_file, submodel_no = 1, is_mod
if ("m" + dtypestr) in model_filename:
dtypestr = "m" + dtypestr
quanto_dtypestr = "m" + quanto_dtypestr
- if fl.locate_file(model_filename) is None and (not no_fp16_main_model or dtype == torch.bfloat16):
+ if fl.locate_file(model_filename, error_if_none= False) is None and (not no_fp16_main_model or dtype == torch.bfloat16):
offload.save_model(model, model_filename_path, config_file_path=config_file, filter_sd=filter)
print(f"New model file '{model_filename}' had been created for finetune Id '{model_type}'.")
del saved_finetune_def["model"][source_key]
@@ -2759,7 +2759,7 @@ def save_model(model, model_type, dtype, config_file, submodel_no = 1, is_mod
quanto_filename_path = os.path.join(fl.get_download_folder() , quanto_filename)
if hasattr(model, "_quanto_map"):
print("unable to generate quantized module, the main model should at full 16 bits before quantization can be done")
- elif fl.locate_file(quanto_filename) is None:
+ elif fl.locate_file(quanto_filename, error_if_none= False) is None:
offload.save_model(model, quanto_filename_path, config_file_path=config_file, do_quantize= True, filter_sd=filter)
print(f"New quantized file '{quanto_filename}' had been created for finetune Id '{model_type}'.")
if isinstance(model_def[url_key][0],dict):