Skip to content

Commit

Permalink
Remove cache folder from image data folder (#1446)
Browse files Browse the repository at this point in the history
Co-authored-by: regisss <15324346+regisss@users.noreply.github.com>
  • Loading branch information
shepark and regisss authored Oct 22, 2024
1 parent 77cdcf6 commit fc54347
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/stable-diffusion/training/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -281,6 +282,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
Expand Down

0 comments on commit fc54347

Please sign in to comment.