klse-chatbot / app.py
cjzhi98's picture
Upload 3 files
e72da8a verified
raw
history blame contribute delete
556 Bytes
import gradio as gr
import os
from dataset_loader import load_dataset
if not os.path.isdir("klse_cahtbot_data"):
load_dataset()
from klse_cahtbot_data.conversation import run_conversation
# Initialize the conversation
conversation = []
def respond_to_input(user_input):
response = run_conversation(user_input)
return response
# Create the Gradio interface
iface = gr.Interface(
title="KLSE chatbot", fn=respond_to_input, inputs="text", outputs="text"
)
iface.queue(default_concurrency_limit=None)
# Launch the app
iface.launch()