mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2026-04-23 00:17:25 +08:00
[BugFix] Avoid loading training file (#4966)
* bug fix don't put scheduler.pdparams into model weights * run pre-commit
This commit is contained in:
@@ -398,9 +398,9 @@ def get_all_weights_file(model_path: str):
|
||||
"""
|
||||
model_path = Path(model_path)
|
||||
use_safetensors = True
|
||||
if any(model_path.glob("*.pdparams")):
|
||||
files_list = [file for file in model_path.glob("*.pdparams") if file.name != "scheduler.pdparams"]
|
||||
if len(files_list) > 0:
|
||||
key_name_list = []
|
||||
files_list = [str(file) for file in model_path.glob("*.pdparams")]
|
||||
use_safetensors = False
|
||||
else:
|
||||
safe_model_path = model_path / "model.safetensors"
|
||||
|
||||
Reference in New Issue
Block a user