Update README.md
Browse filesfix: used wrong target directory to check for cached download
README.md
CHANGED
|
@@ -44,18 +44,18 @@ from langchain.vectorstores.faiss import FAISS
|
|
| 44 |
from huggingface_hub import snapshot_download
|
| 45 |
|
| 46 |
# download the vectorstore for the book you want
|
| 47 |
-
|
| 48 |
cache_dir=f"{book}_cache"
|
| 49 |
vectorstore = snapshot_download(repo_id="calmgoose/book-embeddings",
|
| 50 |
repo_type="dataset",
|
| 51 |
revision="main",
|
| 52 |
-
allow_patterns=f"books/{
|
| 53 |
cache_dir=cache_dir,
|
| 54 |
)
|
| 55 |
|
| 56 |
# get path to the `vectorstore` folder that you just downloaded
|
| 57 |
# we'll look inside the `cache_dir` for the folder we want
|
| 58 |
-
target_dir =
|
| 59 |
|
| 60 |
# Walk through the directory tree recursively
|
| 61 |
for root, dirs, files in os.walk(cache_dir):
|
|
|
|
| 44 |
from huggingface_hub import snapshot_download
|
| 45 |
|
| 46 |
# download the vectorstore for the book you want
|
| 47 |
+
BOOK="1984"
|
| 48 |
cache_dir=f"{book}_cache"
|
| 49 |
vectorstore = snapshot_download(repo_id="calmgoose/book-embeddings",
|
| 50 |
repo_type="dataset",
|
| 51 |
revision="main",
|
| 52 |
+
allow_patterns=f"books/{BOOK}/*", # to download only the one book
|
| 53 |
cache_dir=cache_dir,
|
| 54 |
)
|
| 55 |
|
| 56 |
# get path to the `vectorstore` folder that you just downloaded
|
| 57 |
# we'll look inside the `cache_dir` for the folder we want
|
| 58 |
+
target_dir = BOOK
|
| 59 |
|
| 60 |
# Walk through the directory tree recursively
|
| 61 |
for root, dirs, files in os.walk(cache_dir):
|