MEOW commited on
Commit
40e2500
·
unverified ·
1 Parent(s): be5be6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
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."