Spaces:
Sleeping
Sleeping
Update pdfchatbot.py
Browse files- pdfchatbot.py +4 -6
pdfchatbot.py
CHANGED
@@ -72,13 +72,11 @@ class PDFChatBot:
|
|
72 |
"""
|
73 |
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
|
74 |
docs = text_splitter.split_documents(self.documents)
|
75 |
-
|
76 |
-
auth_config = weaviate.AuthApiKey(api_key=os.getenv("WEAVIATE_API_KEY"))
|
77 |
|
78 |
-
weaviate_client = weaviate.
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
|
83 |
self.vectordb = WeaviateVectorStore.from_documents(docs, self.embeddings, client=weaviate_client)
|
84 |
|
|
|
72 |
"""
|
73 |
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
|
74 |
docs = text_splitter.split_documents(self.documents)
|
|
|
|
|
75 |
|
76 |
+
weaviate_client = weaviate.connect_to_wcs(
|
77 |
+
cluster_url=os.getenv("WEAVIATE_URL"),
|
78 |
+
auth_credentials=weaviate.auth.AuthApiKey(os.getenv("WEAVIATE_API_KEY"))
|
79 |
+
)
|
80 |
|
81 |
self.vectordb = WeaviateVectorStore.from_documents(docs, self.embeddings, client=weaviate_client)
|
82 |
|