Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -221,7 +221,7 @@ def index_document_content(doc_content, doc_id):
|
|
| 221 |
texts = text_splitter.split_text(doc_content)
|
| 222 |
|
| 223 |
# Create embeddings for each chunk
|
| 224 |
-
embeddings = OpenAIEmbeddings(openai_api_key=
|
| 225 |
doc_metadata = [{"doc_id": doc_id, "chunk_id": i} for i in range(len(texts))]
|
| 226 |
vector_store = FAISS.from_texts(texts, embeddings, metadatas=doc_metadata)
|
| 227 |
|
|
|
|
| 221 |
texts = text_splitter.split_text(doc_content)
|
| 222 |
|
| 223 |
# Create embeddings for each chunk
|
| 224 |
+
embeddings = OpenAIEmbeddings(openai_api_key=openai_api_key)
|
| 225 |
doc_metadata = [{"doc_id": doc_id, "chunk_id": i} for i in range(len(texts))]
|
| 226 |
vector_store = FAISS.from_texts(texts, embeddings, metadatas=doc_metadata)
|
| 227 |
|