From 1fce8b902ac29c463e927b0b54dd50f0c3b98e6a Mon Sep 17 00:00:00 2001 From: Dimitri Saridakis Date: Mon, 20 Nov 2023 12:01:23 +0000 Subject: [PATCH] fix: unzip and delete zipped files --- demo-notebooks/guided-demos/download_mnist_datasets.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/demo-notebooks/guided-demos/download_mnist_datasets.py b/demo-notebooks/guided-demos/download_mnist_datasets.py index 6493296fb..52c2dd17e 100644 --- a/demo-notebooks/guided-demos/download_mnist_datasets.py +++ b/demo-notebooks/guided-demos/download_mnist_datasets.py @@ -39,6 +39,10 @@ def download_mnist_dataset(destination_dir): print(f"MNIST dataset downloaded in {destination_dir}") + # unzip the gzipped files + [os.system(f"gunzip {destination_dir}/{file}") for file in os.listdir(destination_dir) if file.endswith(".gz")] + # delete the gzipped files + [os.remove(f"{destination_dir}/{file}") for file in os.listdir(destination_dir) if file.endswith(".gz")] # Specify the directory where you destination_dir = os.path.dirname(os.path.abspath(__file__))