File size: 413 Bytes
3d9e42e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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")