Skip to content

Commit dd61a52

Browse files
Fix clean-up in build_spec.add_weights
1 parent 9332de8 commit dd61a52

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bioimageio/core/build_spec/add_weights.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ def add_weights(
6464
raise e
6565
finally:
6666
# clean up tmp files
67-
os.remove(weight_out)
67+
if Path(weight_out).absolute() != Path(weight_uri).absolute():
68+
os.remove(weight_out)
6869
if tmp_arch is not None:
6970
os.remove(tmp_arch)
7071
# for some reason the weights are also copied to the cwd.

0 commit comments

Comments
 (0)