From 81715ce651c15ecfc968cba46a1dc1f678d1e541 Mon Sep 17 00:00:00 2001 From: Seunghyuk Park Date: Tue, 22 Oct 2024 03:51:15 +0000 Subject: [PATCH 1/2] Remove cache folder from image data folder --- examples/stable-diffusion/training/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/stable-diffusion/training/README.md b/examples/stable-diffusion/training/README.md index 28e2d4e8c0..796a9eb126 100644 --- a/examples/stable-diffusion/training/README.md +++ b/examples/stable-diffusion/training/README.md @@ -281,6 +281,12 @@ snapshot_download( local_dir=local_dir, repo_type="dataset", ignore_patterns=".gitattributes", ) + +# check if .cache folder exists and remove it. +cache_folder = os.path.join(local_dir, ".cache") +if os.path.exists(cache_folder): + import shutil + shutil.rmtree(cache_folder) ``` ### Full model finetune From 1aa105fd73f9e4528c4dc63cb446c8e896e5b17f Mon Sep 17 00:00:00 2001 From: regisss <15324346+regisss@users.noreply.github.com> Date: Tue, 22 Oct 2024 08:21:40 +0000 Subject: [PATCH 2/2] Add `import os` --- examples/stable-diffusion/training/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/stable-diffusion/training/README.md b/examples/stable-diffusion/training/README.md index 796a9eb126..0a74b3c558 100644 --- a/examples/stable-diffusion/training/README.md +++ b/examples/stable-diffusion/training/README.md @@ -273,6 +273,7 @@ Now let's get our dataset. For this example we will use some dog images: https:/ Let's first download it locally: ```python +import os from huggingface_hub import snapshot_download local_dir = "./dog"