calmgoose commited on
Commit
24fda38
1 Parent(s): a659f94

Update README.md

Browse files

fix: used wrong target directory to check for cached download

Files changed (1) hide show
  1. README.md +3 -3
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
- 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 = f"books/{book}"
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):