Skip to content

Commit

Permalink
Verify model deletion after testing (#6127)
Browse files Browse the repository at this point in the history
### Description
Deletes model downloaded to disk after testing to avoid storage issues.

---------

Signed-off-by: Ramakrishnan Sivakumar <ramkrishna2910@gmail.com>
  • Loading branch information
ramkrishna2910 committed May 3, 2024
1 parent 9ee76ea commit 7513c16
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions workflow_scripts/test_model_zoo.py
Expand Up @@ -6,6 +6,7 @@
import argparse
import gc
import os
import shutil
import sys
import time

Expand Down Expand Up @@ -95,8 +96,10 @@ def main():
)

# remove the model to save space in CIs
if os.path.exists(model_name):
os.remove(model_name)
full_model_path = os.path.join(hub._ONNX_HUB_DIR, model_path)
parent_dir = os.path.dirname(full_model_path)
if os.path.exists(parent_dir):
shutil.rmtree(parent_dir)

except Exception as e: # noqa: BLE001
print(f"[FAIL]: {e}")
Expand Down

0 comments on commit 7513c16

Please sign in to comment.