Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,7 +32,7 @@ def get_text_chunks(text):
|
|
| 32 |
|
| 33 |
def create_vector_store(text_chunks):
|
| 34 |
try:
|
| 35 |
-
embeddings = GoogleGenerativeAIEmbeddings(model
|
| 36 |
vector_store = FAISS.from_texts(text_chunks, embedding=embeddings)
|
| 37 |
vector_store.save_local(INDEX_PATH)
|
| 38 |
return "PDFs processed successfully! Vector store saved. Now you can ask questions."
|
|
@@ -41,7 +41,7 @@ def create_vector_store(text_chunks):
|
|
| 41 |
|
| 42 |
def load_vector_store():
|
| 43 |
try:
|
| 44 |
-
embeddings = GoogleGenerativeAIEmbeddings(model="
|
| 45 |
if os.path.exists(INDEX_PATH):
|
| 46 |
return FAISS.load_local(INDEX_PATH, embeddings, allow_dangerous_deserialization=True)
|
| 47 |
return None
|
|
|
|
| 32 |
|
| 33 |
def create_vector_store(text_chunks):
|
| 34 |
try:
|
| 35 |
+
embeddings = GoogleGenerativeAIEmbeddings(model"models/gemini-embedding-001", google_api_key=GOOGLE_API_KEY)
|
| 36 |
vector_store = FAISS.from_texts(text_chunks, embedding=embeddings)
|
| 37 |
vector_store.save_local(INDEX_PATH)
|
| 38 |
return "PDFs processed successfully! Vector store saved. Now you can ask questions."
|
|
|
|
| 41 |
|
| 42 |
def load_vector_store():
|
| 43 |
try:
|
| 44 |
+
embeddings = GoogleGenerativeAIEmbeddings(model="models/gemini-embedding-001", google_api_key=GOOGLE_API_KEY)
|
| 45 |
if os.path.exists(INDEX_PATH):
|
| 46 |
return FAISS.load_local(INDEX_PATH, embeddings, allow_dangerous_deserialization=True)
|
| 47 |
return None
|