Spaces:
Sleeping
Sleeping
import gradio as gr | |
import openai | |
from osbot_utils.utils.Dev import pprint | |
from osbot_utils.utils.Misc import list_set | |
from cbr_athena.api.Chat_Predict import Chat_Predict | |
from cbr_athena.api.Open_API import Open_API | |
TITLE = "# Athena (Cyber Security Advisor)" | |
class Gradio_Main: | |
def __init__(self): | |
#self.demo = None | |
pass | |
def title(self): | |
return TITLE | |
def add_chat_bot(self): | |
default_text = "Hi, good morning" | |
gr.Markdown(self.title()) | |
chat_predict = Chat_Predict() | |
textbox_input = gr.Textbox(value=default_text, render=False) | |
gr.ChatInterface(chat_predict.predict, textbox=textbox_input) | |
def create_demo(self): | |
with gr.Blocks() as demo: | |
self.add_chat_bot() | |
demo.queue() | |
return demo | |