Denys9's picture
change
503882a
raw
history blame
589 Bytes
from gpt_index import GPTSimpleVectorIndex
import gradio as gr
import os
os.environ["OPENAI_API_KEY"] = "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"
def chatbot(input_text):
index = GPTSimpleVectorIndex.load_from_disk('index.json')
response = index.query(input_text)
return response.response
demo = gr.Interface(fn=chatbot,
inputs=gr.components.Textbox(lines=7, label="Enter your question"),
outputs=gr.components.Textbox(lines=7, label="Enter your question"),
title="Gamecraft AI Chatbot")
demo.launch()