File size: 967 Bytes
2fa7c8f 767ca1c b618f08 767ca1c b618f08 767ca1c efef7be 2fa7c8f 767ca1c 2fa7c8f efef7be 2fa7c8f efef7be b618f08 2fa7c8f 767ca1c b618f08 767ca1c b618f08 767ca1c efef7be 767ca1c 2fa7c8f efef7be |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
import gradio as gr
import openai
from osbot_utils.utils.Dev import pprint
from osbot_utils.utils.Misc import list_set
from test_bot.api.Chat_Predict import Chat_Predict
from test_bot.api.Open_API import Open_API
Open_API().setup()
TITLE = "# Meet Bobby Tables (head of Application Security). v0.2.0"
class Gradio_Test:
def __init__(self):
#self.demo = None
pass
def title(self):
return TITLE
def create_demo(self):
#return gr.ChatInterface(self.predict).queue()
default_text = "Hi, good morning"
chat_predict = Chat_Predict()
with gr.Blocks() as demo:
gr.Markdown(self.title())
textbox_input = gr.Textbox(value=default_text , render=False)
gr.ChatInterface(chat_predict.predict, textbox=textbox_input)
demo.queue()
#self.demo = demo
return demo
# def launch(self):
# self.demo.queue()
# #self.demo.launch() |