Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,8 +35,7 @@ def get_text_chunks(text):
|
|
| 35 |
# Function to get embeddings for each chunk and save to vector store
|
| 36 |
def get_vector_store(chunks):
|
| 37 |
try:
|
| 38 |
-
|
| 39 |
-
embeddings = aiplatform.GoogleGenerativeAIEmbeddings(model="text-embedding-004")
|
| 40 |
vector_store = FAISS.from_texts(chunks, embedding=embeddings)
|
| 41 |
vector_store.save_local("faiss_index")
|
| 42 |
except (GoogleAPIError, InvalidArgument):
|
|
|
|
| 35 |
# Function to get embeddings for each chunk and save to vector store
|
| 36 |
def get_vector_store(chunks):
|
| 37 |
try:
|
| 38 |
+
embeddings = GoogleGenerativeAIEmbeddings(model="models/text-embedding-004")
|
|
|
|
| 39 |
vector_store = FAISS.from_texts(chunks, embedding=embeddings)
|
| 40 |
vector_store.save_local("faiss_index")
|
| 41 |
except (GoogleAPIError, InvalidArgument):
|