Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ HF_TOKEN = os.environ["HF_TOKEN"]
|
|
34 |
# added for Docker purposes compared to run chainlit app
|
35 |
DATA_DIR = "./data"
|
36 |
VECTORSTORE_DIR = os.path.join(DATA_DIR, "vectorstore")
|
37 |
-
|
38 |
|
39 |
|
40 |
# -- RETRIEVAL -- #
|
@@ -94,7 +94,7 @@ hf_embeddings = HuggingFaceEndpointEmbeddings(
|
|
94 |
huggingfacehub_api_token=os.environ["HF_TOKEN"],
|
95 |
)
|
96 |
## Prevent re-indexing if vectorstores already exists
|
97 |
-
if os.path.exists(
|
98 |
vectorstore = FAISS.load_local(
|
99 |
VECTORSTORE_DIR,#"./data/vectorstore",
|
100 |
hf_embeddings,
|
|
|
34 |
# added for Docker purposes compared to run chainlit app
|
35 |
DATA_DIR = "./data"
|
36 |
VECTORSTORE_DIR = os.path.join(DATA_DIR, "vectorstore")
|
37 |
+
VECTORSTORE_PATH = os.path.join(VECTORSTORE_DIR, "index.faiss")
|
38 |
|
39 |
|
40 |
# -- RETRIEVAL -- #
|
|
|
94 |
huggingfacehub_api_token=os.environ["HF_TOKEN"],
|
95 |
)
|
96 |
## Prevent re-indexing if vectorstores already exists
|
97 |
+
if os.path.exists(VECTORSTORE_PATH):
|
98 |
vectorstore = FAISS.load_local(
|
99 |
VECTORSTORE_DIR,#"./data/vectorstore",
|
100 |
hf_embeddings,
|