diff --git a/hpvm/projects/torch2hpvm/torch2hpvm/compile.py b/hpvm/projects/torch2hpvm/torch2hpvm/compile.py
index bb4ce581f835c6bc262ef2af223c6c73b08949f3..946fd27d39d66df615e47db2b3935e05354bf11e 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):