Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,7 +38,7 @@ def get_text_chunks(text):
|
|
| 38 |
def get_vector_store(text_chunks):
|
| 39 |
embeddings = GoogleGenerativeAIEmbeddings(model = "models/embedding-001")
|
| 40 |
vector_store = FAISS.from_texts(text_chunks, embedding=embeddings)
|
| 41 |
-
|
| 42 |
|
| 43 |
|
| 44 |
def get_conversational_chain():
|
|
@@ -65,8 +65,8 @@ def get_conversational_chain():
|
|
| 65 |
def user_input(user_question):
|
| 66 |
embeddings = GoogleGenerativeAIEmbeddings(model = "models/embedding-001")
|
| 67 |
|
| 68 |
-
|
| 69 |
-
docs =
|
| 70 |
|
| 71 |
chain = get_conversational_chain()
|
| 72 |
|
|
|
|
| 38 |
def get_vector_store(text_chunks):
|
| 39 |
embeddings = GoogleGenerativeAIEmbeddings(model = "models/embedding-001")
|
| 40 |
vector_store = FAISS.from_texts(text_chunks, embedding=embeddings)
|
| 41 |
+
vector_store.save_local("faiss_index")
|
| 42 |
|
| 43 |
|
| 44 |
def get_conversational_chain():
|
|
|
|
| 65 |
def user_input(user_question):
|
| 66 |
embeddings = GoogleGenerativeAIEmbeddings(model = "models/embedding-001")
|
| 67 |
|
| 68 |
+
new_db = FAISS.load_local("faiss_index", embeddings)
|
| 69 |
+
docs = new_db.similarity_search(user_question)
|
| 70 |
|
| 71 |
chain = get_conversational_chain()
|
| 72 |
|