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)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay