Spaces:
Sleeping
Sleeping
| 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() | |