GreenRaptor commited on
Commit
4516d66
·
1 Parent(s): ed151e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +51 -31
app.py CHANGED
@@ -21,37 +21,57 @@ def bot(history):
21
  time.sleep(0.05)
22
  yield history
23
 
24
- with gr.Blocks() as demo:
25
- # chatbot = gr.Chatbot()
26
- # msg = gr.Textbox()
27
- chatbot = gr.Chatbot([], show_label=False, elem_id="chatbot").style(height=500)
28
-
29
- with gr.Row():
30
- with gr.Column(scale=0.85):
31
- txt = gr.Textbox(
32
- show_label=False,
33
- placeholder="Type your response and press enter, or record your response",
34
- ).style(container=False)
35
- with gr.Column(scale=0.15, min_width=0):
36
- submit = gr.Button("Submit")
37
- # gr.Interface(
38
- # fn=transcribe,
39
- # inputs=[
40
- # gr.Audio(source="microphone", type="filepath", streaming=True),
41
- # "state"
42
- # ],
43
- # outputs=[
44
- # msg,
45
- # "state"
46
- # ],
47
- # live=True)
48
-
49
- txt.submit(user, [txt, chatbot], [txt, chatbot], queue=False).then(
50
- bot, chatbot, chatbot
51
- )
52
- submit.click(user, [txt, chatbot], [txt, chatbot], queue=False).then(
53
- bot, chatbot, chatbot
54
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  demo.queue()
57
  demo.launch()
 
21
  time.sleep(0.05)
22
  yield history
23
 
24
+ css = """
25
+ .gradio-container {
26
+ font-family: 'IBM Plex Sans', sans-serif;
27
+ }
28
+ .gr-button {
29
+ color: white;
30
+ border-color: black;
31
+ background: black;
32
+ }
33
+ .container {
34
+ max-width: 730px;
35
+ margin: auto;
36
+ padding-top: 1.5rem;
37
+ }
38
+ """
39
+
40
+ with gr.Blocks(css=css) as demo:
41
+
42
+ with gr.Box():
43
+
44
+ # chatbot = gr.Chatbot()
45
+ # msg = gr.Textbox()
46
+ chatbot = gr.Chatbot([], show_label=False, elem_id="chatbot").style(min-height=30rem)
47
+
48
+ # with gr.Row():
49
+ with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
50
+ with gr.Column(scale=0.85):
51
+ txt = gr.Textbox(
52
+ show_label=False,
53
+ placeholder="Type your response and press enter, or record your response",
54
+ ).style(container=False)
55
+ with gr.Column(scale=0.15, min_width=0):
56
+ submit = gr.Button("Submit")
57
+ # gr.Interface(
58
+ # fn=transcribe,
59
+ # inputs=[
60
+ # gr.Audio(source="microphone", type="filepath", streaming=True),
61
+ # "state"
62
+ # ],
63
+ # outputs=[
64
+ # msg,
65
+ # "state"
66
+ # ],
67
+ # live=True)
68
+
69
+ txt.submit(user, [txt, chatbot], [txt, chatbot], queue=False).then(
70
+ bot, chatbot, chatbot
71
+ )
72
+ submit.click(user, [txt, chatbot], [txt, chatbot], queue=False).then(
73
+ bot, chatbot, chatbot
74
+ )
75
 
76
  demo.queue()
77
  demo.launch()