From d055e7d29f56abc7c2ee2f338d5822347981c85a Mon Sep 17 00:00:00 2001 From: Eric Kerfoot Date: Fri, 8 Nov 2024 09:08:14 +0000 Subject: [PATCH] Update from comments Signed-off-by: Eric Kerfoot --- generation/3d_ddpm/3d_ddpm_tutorial.ipynb | 25 +++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/generation/3d_ddpm/3d_ddpm_tutorial.ipynb b/generation/3d_ddpm/3d_ddpm_tutorial.ipynb index 52d976bd7..309d3d740 100644 --- a/generation/3d_ddpm/3d_ddpm_tutorial.ipynb +++ b/generation/3d_ddpm/3d_ddpm_tutorial.ipynb @@ -48,7 +48,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "cdea37d5", "metadata": {}, "outputs": [ @@ -93,6 +93,7 @@ "import os\n", "import tempfile\n", "import time\n", + "import shutil\n", "\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", @@ -633,7 +634,6 @@ "name": "stderr", "output_type": "stream", "text": [ - "You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.\n", "100%|██████████| 1000/1000 [00:31<00:00, 31.56it/s]\n" ] } @@ -741,6 +741,27 @@ "plt.axis(\"off\")\n", "plt.show()" ] + }, + { + "cell_type": "markdown", + "id": "b39a47bb", + "metadata": {}, + "source": [ + "### Cleanup data directory\n", + "\n", + "Remove directory if a temporary was used." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "957a45ff", + "metadata": {}, + "outputs": [], + "source": [ + "if directory is None:\n", + " shutil.rmtree(root_dir)" + ] } ], "metadata": {