Spaces:
Sleeping
Sleeping
solve db position
Browse files
app.py
CHANGED
@@ -215,12 +215,12 @@ def main():
|
|
215 |
data.extend(data_dir)
|
216 |
|
217 |
#create vector from upload
|
218 |
-
if len(data) > 0 :
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
with st.spinner('Wait for create vector'):
|
223 |
-
|
224 |
# db.save_local(DB_FAISS_UPLOAD_PATH)
|
225 |
# st.write(f"Your model is already store in {DB_FAISS_UPLOAD_PATH}")
|
226 |
|
|
|
215 |
data.extend(data_dir)
|
216 |
|
217 |
#create vector from upload
|
218 |
+
#if len(data) > 0 :
|
219 |
+
sp_docs = split_docs(documents = data)
|
220 |
+
st.write(f"This document have {len(sp_docs)} chunks")
|
221 |
+
embeddings = load_embeddings()
|
222 |
+
# with st.spinner('Wait for create vector'):
|
223 |
+
db = FAISS.from_documents(sp_docs, embeddings)
|
224 |
# db.save_local(DB_FAISS_UPLOAD_PATH)
|
225 |
# st.write(f"Your model is already store in {DB_FAISS_UPLOAD_PATH}")
|
226 |
|