Spaces:
Sleeping
Sleeping
import gradio as gr | |
from gpt_index import GPTSimpleVectorIndex | |
def chatbot(input_text): | |
index = GPTSimpleVectorIndex.load_from_disk('index.json') | |
response = index.query(input_text, response_mode="compact") | |
return response.response | |
iface = gr.Interface(fn=chatbot, inputs="text", outputs="text") | |
iface.launch() | |