Spaces:
Sleeping
Sleeping
Update vlog4chat.py
Browse files- vlog4chat.py +6 -3
vlog4chat.py
CHANGED
@@ -161,9 +161,12 @@ class Vlogger4chat :
|
|
161 |
print("The log file is empty or could not be loaded.")
|
162 |
return False # 如果 raw_documents 为空或所有内容都为空白,直接返回
|
163 |
# Split text
|
164 |
-
text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=50)
|
165 |
-
chunks = text_splitter.split_documents(raw_documents)
|
166 |
-
self.vector_storage = FAISS.from_documents(chunks, self.my_embedding)
|
|
|
|
|
|
|
167 |
self.chain = ConversationalRetrievalChain.from_llm(self.llm, self.vector_storage.as_retriever(), return_source_documents=True)
|
168 |
return True
|
169 |
return False
|
|
|
161 |
print("The log file is empty or could not be loaded.")
|
162 |
return False # 如果 raw_documents 为空或所有内容都为空白,直接返回
|
163 |
# Split text
|
164 |
+
#text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=50)
|
165 |
+
#chunks = text_splitter.split_documents(raw_documents)
|
166 |
+
#self.vector_storage = FAISS.from_documents(chunks, self.my_embedding)
|
167 |
+
with open('./BV11H4y1F7uH.pkl', 'rb') as f:
|
168 |
+
self.vector_storage =pickle.load(f)
|
169 |
+
|
170 |
self.chain = ConversationalRetrievalChain.from_llm(self.llm, self.vector_storage.as_retriever(), return_source_documents=True)
|
171 |
return True
|
172 |
return False
|