Spaces:
Runtime error
Runtime error
Download pages/chat_ui.py from NexusInstruments/omniscientframework: direct link, hf CLI and curl.
- Browser
- Download file 413 Bytes
-
https://huggingface.co/spaces/NexusInstruments/omniscientframework/resolve/main/pages/chat_ui.py
- Command line
-
hf download hf://spaces/NexusInstruments/omniscientframework/pages/chat_ui.py
-
curl -L -o chat_ui.py https://huggingface.co/spaces/NexusInstruments/omniscientframework/resolve/main/pages/chat_ui.py
413 Bytes
| import gradio as gr | |
| import os, sys | |
| BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | |
| UTILS_DIR = os.path.join(BASE_DIR, "utils") | |
| if UTILS_DIR not in sys.path: | |
| sys.path.insert(0, UTILS_DIR) | |
| from backend import run_llm | |
| def create_chat_interface(): | |
| def chat_fn(message, history): | |
| reply = run_llm(message) | |
| return reply | |
| return gr.ChatInterface(chat_fn, title="Omniscient Chatbot") | |