"server/vscode:/vscode.git/clone" did not exist on "9e2fdf57c04bae65827b2b03ad2b696eb6e8dec7"
Unverified Commit 5af6eed9 authored by lowinli's avatar lowinli Committed by GitHub
Browse files

debug an exception (#638)



* debug an exception

if dst_path is not a file, it will raise Exception in the function src_path.samefile:
FileNotFoundError: [Errno 2] No such file or directory: '/home/lilongwei/notebook/onnx_diffusion/vae_decoder/model.onnx'

* Update src/diffusers/onnx_utils.py
Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
parent f3983d16
......@@ -79,8 +79,10 @@ class OnnxRuntimeModel:
src_path = self.model_save_dir.joinpath(self.latest_model_name)
dst_path = Path(save_directory).joinpath(model_file_name)
if not src_path.samefile(dst_path):
try:
shutil.copyfile(src_path, dst_path)
except shutil.SameFileError:
pass
def save_pretrained(
self,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment