Spaces:
Runtime error
Runtime error
alekzan commited on
Commit ·
fccb071
1
Parent(s): a271a25
Add app.py and requirements.txt for the Space
Browse files- app.py +4 -4
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -42,7 +42,7 @@ llama_3_2 = "llama-3.2-90b-vision-preview"
|
|
| 42 |
|
| 43 |
def process_docs_and_get_retriever(
|
| 44 |
doc_path: str,
|
| 45 |
-
persist_directory="/
|
| 46 |
collection_name: str = "user_data",
|
| 47 |
k: int = 4,
|
| 48 |
):
|
|
@@ -119,7 +119,7 @@ def process_text_as_retriever(text: str):
|
|
| 119 |
A retriever object for querying the vector store.
|
| 120 |
"""
|
| 121 |
# Hard-coded parameters
|
| 122 |
-
persist_directory = "/
|
| 123 |
collection_name = "user_data"
|
| 124 |
k = 4
|
| 125 |
|
|
@@ -161,7 +161,7 @@ def process_text_as_retriever(text: str):
|
|
| 161 |
|
| 162 |
|
| 163 |
def recreate_retriever(
|
| 164 |
-
persist_directory: str = "/
|
| 165 |
collection_name: str = "user_data",
|
| 166 |
):
|
| 167 |
"""
|
|
@@ -178,7 +178,7 @@ def recreate_retriever(
|
|
| 178 |
|
| 179 |
|
| 180 |
# Check if the path exists
|
| 181 |
-
chroma_db_path = "/
|
| 182 |
|
| 183 |
if not os.path.exists(chroma_db_path):
|
| 184 |
doc_path = "./data/docs/goldmine.docx"
|
|
|
|
| 42 |
|
| 43 |
def process_docs_and_get_retriever(
|
| 44 |
doc_path: str,
|
| 45 |
+
persist_directory="/workspace/chroma_langchain_db",
|
| 46 |
collection_name: str = "user_data",
|
| 47 |
k: int = 4,
|
| 48 |
):
|
|
|
|
| 119 |
A retriever object for querying the vector store.
|
| 120 |
"""
|
| 121 |
# Hard-coded parameters
|
| 122 |
+
persist_directory = "/workspace/chroma_langchain_db"
|
| 123 |
collection_name = "user_data"
|
| 124 |
k = 4
|
| 125 |
|
|
|
|
| 161 |
|
| 162 |
|
| 163 |
def recreate_retriever(
|
| 164 |
+
persist_directory: str = "/workspace/chroma_langchain_db",
|
| 165 |
collection_name: str = "user_data",
|
| 166 |
):
|
| 167 |
"""
|
|
|
|
| 178 |
|
| 179 |
|
| 180 |
# Check if the path exists
|
| 181 |
+
chroma_db_path = "/workspace/chroma_langchain_db"
|
| 182 |
|
| 183 |
if not os.path.exists(chroma_db_path):
|
| 184 |
doc_path = "./data/docs/goldmine.docx"
|
requirements.txt
CHANGED
|
@@ -8,6 +8,7 @@ chromadb==0.5.20
|
|
| 8 |
click==8.1.7
|
| 9 |
coloredlogs==15.0.1
|
| 10 |
decorator==5.1.1
|
|
|
|
| 11 |
frozenlist==1.5.0
|
| 12 |
gradio==5.6.0
|
| 13 |
gradio_client==1.4.3
|
|
|
|
| 8 |
click==8.1.7
|
| 9 |
coloredlogs==15.0.1
|
| 10 |
decorator==5.1.1
|
| 11 |
+
docx2txt
|
| 12 |
frozenlist==1.5.0
|
| 13 |
gradio==5.6.0
|
| 14 |
gradio_client==1.4.3
|