File size: 686 Bytes
c65ff85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from llama_index import StorageContext, load_index_from_storage
import gradio as gr

def chatbot(zask="Where is Florida?"):
    storage_context = StorageContext.from_defaults(persist_dir='Meta_Index\FloridaSutLaws')
    index = load_index_from_storage(storage_context)
    query_engine = index.as_query_engine()
    response = query_engine.query(zask)
    return response

iface = gr.Interface(fn=chatbot,
                     inputs=gr.components.Textbox(lines=7, label="Input Text"),
                     outputs=gr.components.Textbox(lines=7, label="Output Text"),
                     title="Chatbot regarding Florida Sales & Use Tax Statutes and Codes")

iface.launch(share=True)