Pudding48 commited on
Commit
cc5bd3b
·
verified ·
1 Parent(s): 4e90566

Update prepare_vector_dp.py

Browse files
Files changed (1) hide show
  1. prepare_vector_dp.py +6 -2
prepare_vector_dp.py CHANGED
@@ -8,8 +8,11 @@ from huggingface_hub import hf_hub_download
8
  # from llama_cpp import Llama
9
  import os
10
 
 
 
 
 
11
 
12
- os.environ["HF_HOME"] = "/home/user/app/hf_cache"
13
 
14
  # Khai bao bien
15
  pdf_data_path = "data"
@@ -17,7 +20,8 @@ vector_dp_path = "vectorstores/db_faiss"
17
 
18
  model_file = hf_hub_download(
19
  repo_id="Pudding48/TinyLlamaTest", # 🟢 This must be a model repo, not a Space
20
- filename="tinyllama-1.1b-chat-v1.0.Q8_0.gguf"
 
21
  )
22
 
23
  # Ham 1. Tao ra vector DB tu 1 doan text
 
8
  # from llama_cpp import Llama
9
  import os
10
 
11
+ cache_path = "/home/user/app/hf_cache"
12
+ os.makedirs(cache_path, exist_ok=True)
13
+
14
+ #os.environ["HF_HOME"] = "/home/user/app/hf_cache"
15
 
 
16
 
17
  # Khai bao bien
18
  pdf_data_path = "data"
 
20
 
21
  model_file = hf_hub_download(
22
  repo_id="Pudding48/TinyLlamaTest", # 🟢 This must be a model repo, not a Space
23
+ filename="tinyllama-1.1b-chat-v1.0.Q8_0.gguf",
24
+ cache_dir=cache_path
25
  )
26
 
27
  # Ham 1. Tao ra vector DB tu 1 doan text