Spaces:
Runtime error
Runtime error
Update to local store
Browse files- app/rag.py +2 -5
- requirements.txt +0 -1
app/rag.py
CHANGED
@@ -15,9 +15,7 @@ from llama_index.vector_stores.qdrant import QdrantVectorStore
|
|
15 |
from qdrant_client import QdrantClient
|
16 |
from llama_index.readers.file.docs.base import DocxReader, HWPReader, PDFReader
|
17 |
|
18 |
-
|
19 |
-
# QDRANT_API_URL = os.getenv('QDRANT_API_URL')
|
20 |
-
# QDRANT_API_KEY = os.getenv('QDRANT_API_KEY')
|
21 |
|
22 |
logging.basicConfig(level=logging.INFO)
|
23 |
logger = logging.getLogger(__name__)
|
@@ -32,8 +30,7 @@ class ChatPDF:
|
|
32 |
self.text_parser = SentenceSplitter(chunk_size=512, chunk_overlap=24)
|
33 |
|
34 |
logger.info("initializing the vector store related objects")
|
35 |
-
|
36 |
-
self.client = QdrantClient(":memory:")
|
37 |
self.vector_store = QdrantVectorStore(
|
38 |
client=self.client,
|
39 |
collection_name="rag_documents",
|
|
|
15 |
from qdrant_client import QdrantClient
|
16 |
from llama_index.readers.file.docs.base import DocxReader, HWPReader, PDFReader
|
17 |
|
18 |
+
store_dir = os.path.expanduser("~/wtp_be_store/")
|
|
|
|
|
19 |
|
20 |
logging.basicConfig(level=logging.INFO)
|
21 |
logger = logging.getLogger(__name__)
|
|
|
30 |
self.text_parser = SentenceSplitter(chunk_size=512, chunk_overlap=24)
|
31 |
|
32 |
logger.info("initializing the vector store related objects")
|
33 |
+
self.client = QdrantClient(path=store_dir)
|
|
|
34 |
self.vector_store = QdrantVectorStore(
|
35 |
client=self.client,
|
36 |
collection_name="rag_documents",
|
requirements.txt
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
fastapi
|
2 |
-
python-dotenv
|
3 |
llama-index
|
4 |
llama-index-vector-stores-qdrant
|
5 |
llama-index-readers-file
|
|
|
1 |
fastapi
|
|
|
2 |
llama-index
|
3 |
llama-index-vector-stores-qdrant
|
4 |
llama-index-readers-file
|