diff --git a/hpvm/projects/torch2hpvm/torch2hpvm/compile.py b/hpvm/projects/torch2hpvm/torch2hpvm/compile.py
index f0d8c3b131231d637429c40b7e68a94627ebd6bf..f469c871f990c0b0abe38465e36a67597c71d5f8 100644
--- a/hpvm/projects/torch2hpvm/torch2hpvm/compile.py
+++ b/hpvm/projects/torch2hpvm/torch2hpvm/compile.py
@@ -201,7 +201,8 @@ class ModelExporter:
 
         def link_from_to(from_: PathLike, to: PathLike):
             from_, to = Path(from_), Path(to)
-            from_.unlink(missing_ok=True)
+            if from_.exists():
+                from_.unlink()
             from_.symlink_to(to.absolute())
 
         if isinstance(dataset, BinDataset):