Spaces:
Runtime error
Runtime error
Download app.py from dahreply/klse-chatbot: direct link, hf CLI and curl.
- Browser
- Download file 556 Bytes
-
https://huggingface.co/spaces/dahreply/klse-chatbot/resolve/main/app.py
- Command line
-
hf download hf://spaces/dahreply/klse-chatbot/app.py
-
curl -L -o app.py https://huggingface.co/spaces/dahreply/klse-chatbot/resolve/main/app.py
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() | |