NFT-AI-Chatbot / app.py
Denys9's picture
Update app.py
d329284
raw
history blame contribute delete
569 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="Answer"),
title="NFT AI Chatbot")
demo.launch()