GovindRaj commited on
Commit
4e4cdb3
·
verified ·
1 Parent(s): 936652d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -5,8 +5,17 @@ from langchain_community.embeddings import HuggingFaceEmbeddings
5
  from langchain_community.vectorstores import FAISS
6
  from langchain_community.llms import CTransformers
7
  from langchain.chains import RetrievalQA
 
8
 
9
- DB_FAISS_PATH = 'https://huggingface.co/spaces/GovindRaj/upload-pdf/tree/main/vectorstore/db_faiss'
 
 
 
 
 
 
 
 
10
 
11
  custom_prompt_template = """Use the following pieces of information to answer the user's question. If you don't know the answer, just say that you don't know, don't try to make up an answer.
12
 
 
5
  from langchain_community.vectorstores import FAISS
6
  from langchain_community.llms import CTransformers
7
  from langchain.chains import RetrievalQA
8
+ from huggingface_hub import snapshot_download
9
 
10
+ # Download the FAISS database files
11
+ local_dir = snapshot_download(
12
+ repo_id="GovindRaj/upload-pdf",
13
+ repo_type="space",
14
+ local_dir="./vectorstore"
15
+ )
16
+
17
+ # Update the path to local directory
18
+ DB_FAISS_PATH = './vectorstore/db_faiss'
19
 
20
  custom_prompt_template = """Use the following pieces of information to answer the user's question. If you don't know the answer, just say that you don't know, don't try to make up an answer.
21