Spaces:
Runtime error
Runtime error
How I can load multiple folder into index query_engine
#1
by
maulikkanani26
- opened
from llama_index import load_index_from_storage, StorageContext
root_dir = "preTrainData"
def ask_question(question):
storage_context = StorageContext.from_defaults(persist_dir=root_dir)
index = load_index_from_storage(storage_context)
query_engine = index.as_query_engine()
prompt_template = "Provide references to sections in the MPEP"
response = query_engine.query(question + " " + prompt_template )
return response.response