File size: 556 Bytes
e72da8a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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()