Skip to content

Commit 7f9cab7

Browse files
Merge pull request #202 from bioimage-io/fix-add-weights
Fix clean-up in build_spec.add_weights
2 parents 9332de8 + dd61a52 commit 7f9cab7

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)