Spaces:
Sleeping
Sleeping
Update app.py
Browse files40 unmodified lines414243444546474849505152535440 unmodified linesdef get_vector_store(text_chunks, api_key):embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001", google_api_key=api_key)vector_store = FAISS.from_texts(text_chunks, embedding=embeddings)vector_store.save_local(FAISS_INDEX_PATH)def get_response(user_question, api_key, chat_history):"""Get response from the AI model with chat history context"""embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001", google_api_key=api_key)new_db = FAISS.load_local(FAISS_INDEX_PATH, embeddings, allow_dangerous_deserialization=True)docs = new_db.similarity_search(user_question, k=4)40 unmodified lines414243444546474849505152535440 unmodified linesdef get_vector_store(text_chunks, api_key):embeddings = GoogleGenerativeAIEmbeddings(model="models/text-embedding-004", google_api_key=api_key)vector_store = FAISS.from_texts(text_chunks, embedding=embeddings)vector_store.save_local(FAISS_INDEX_PATH)def get_response(user_question, api_key, chat_history):"""Get response from the AI model with chat history context"""embeddings = GoogleGenerativeAIEmbeddings(model="models/text-embedding-004", google_api_key=api_key)new_db = FAISS.load_local(FAISS_INDEX_PATH, embeddings, allow_dangerous_deserialization=True)docs = new_db.similarity_search(user_question, k=4)
app.py+2-2