DEV Community

parmarjatin4911@gmail.com
parmarjatin4911@gmail.com

Posted on

AutoLLM with Interface

AutoLLM with Interface

from autollm import AutoQueryEngine
from llama_index import SimpleDirectoryReader
import gradio as gr

documents = SimpleDirectoryReader('data').load_data()

query_engine = AutoQueryEngine.from_parameters(
documents = documents
)

def main(query):
return query_engine.query(query).response

demo = gr.Interface(fn=main, inputs="text", outputs="text")

demo.launch()

Top comments (0)