Spaces:
Paused
Paused
MEOW commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,6 +87,10 @@ def load_documents(file_objs):
|
|
| 87 |
# Create the index from the documents
|
| 88 |
index = VectorStoreIndex.from_documents(documents, storage_context=storage_context)
|
| 89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
# Create the query engine after the index is created
|
| 91 |
query_engine = index.as_query_engine(similarity_top_k=20, streaming=True)
|
| 92 |
return f"Successfully loaded {len(documents)} documents from {len(file_paths)} files."
|
|
|
|
| 87 |
# Create the index from the documents
|
| 88 |
index = VectorStoreIndex.from_documents(documents, storage_context=storage_context)
|
| 89 |
|
| 90 |
+
index = VectorStoreIndex.from_documents(documents,
|
| 91 |
+
storage_context=storage_context,
|
| 92 |
+
embed_model=xai_service.get_embedding) # Directly passing the function instead of a class
|
| 93 |
+
|
| 94 |
# Create the query engine after the index is created
|
| 95 |
query_engine = index.as_query_engine(similarity_top_k=20, streaming=True)
|
| 96 |
return f"Successfully loaded {len(documents)} documents from {len(file_paths)} files."
|