def setup_index(documents):
embed_model = HuggingFaceEmbedding('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
service_context_embedding = ServiceContext.from_defaults(embed_model=embed_model, llm=None, chunk_size=1024)
return VectorStoreIndex.from_documents(documents, service_context=service_context_embedding)
def load_documents():
# Create storage context from persisted data
storage_context = StorageContext.from_defaults(persist_dir="./data")
# Load index from storage context
index = load_index_from_storage(storage_context)
return index
Could not load OpenAI model. If you intended to use OpenAI, please check your OPENAI_API_KEY.
Original error:
No API key found for OpenAI.