Spaces:
Sleeping
Sleeping
Create app.py
#1
by
sparkmy181
- opened
app.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
def predict(inp):
|
3 |
+
return [[inp,inp]]
|
4 |
+
|
5 |
+
def reset_textbox():
|
6 |
+
return gr.update(value='')
|
7 |
+
with gr.Blocks( title='GPT-3.5-turbo by sparkmy') as demo:
|
8 |
+
chatbot = gr.Chatbot(label="bot").style(height=380)
|
9 |
+
txt = gr.Textbox(label='123',placeholder='input')
|
10 |
+
txt.style(container=False)
|
11 |
+
|
12 |
+
with gr.Row():
|
13 |
+
with gr.Column(scale=8):
|
14 |
+
submit = gr.Button('send', variant='primary').style(full_width=True)
|
15 |
+
with gr.Column(scale=2):
|
16 |
+
Hightlightedtext = gr.HighlightedText(show_label=False,value=[("Text","Label 1"),("to be","Label 2"),("highlighted","Label 3")])
|
17 |
+
|
18 |
+
submit.click(predict, inputs=txt, outputs=[chatbot])
|
19 |
+
submit.click(reset_textbox, [], [txt])
|
20 |
+
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")
|
21 |
+
demo.queue(max_size=10)
|
22 |
+
demo.launch(share=False,show_tips=True,show_error=True,debug=True,auth=None)
|
23 |
+
|
24 |
+
|
25 |
+
|