File size: 1,016 Bytes
0f09cc4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
def predict(inp):
    return [[inp,inp]]

def reset_textbox():
    return gr.update(value='')
with gr.Blocks( title='GPT-3.5-turbo by sparkmy') as demo:
    chatbot = gr.Chatbot(label="bot").style(height=380)
    txt = gr.Textbox(label='123',placeholder='input')
    txt.style(container=False)

    with gr.Row():
        with gr.Column(scale=8):
            submit = gr.Button('send', variant='primary').style(full_width=True)
        with gr.Column(scale=2):
            Hightlightedtext = gr.HighlightedText(show_label=False,value=[("Text","Label 1"),("to be","Label 2"),("highlighted","Label 3")])

    submit.click(predict, inputs=txt, outputs=[chatbot])
    submit.click(reset_textbox, [], [txt])
    tab = gr.Tab("Please don't share with too many people, otherwise it will broken down!.And if you want to use it for a long time, please contract with me, my email: sparkmy181@163.com")
demo.queue(max_size=10)
demo.launch(share=False,show_tips=True,show_error=True,debug=True,auth=None)