Spaces:
Runtime error
Runtime error
Commit
·
03de940
1
Parent(s):
19d4a49
Update app.py
Browse files
app.py
CHANGED
@@ -37,73 +37,32 @@ css = """
|
|
37 |
}
|
38 |
#chatbot {
|
39 |
min-height: 30rem;
|
40 |
-
margin:
|
|
|
|
|
41 |
}
|
42 |
"""
|
43 |
|
44 |
with gr.Blocks(css=css) as demo:
|
45 |
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
# <rect width="23" height="23" fill="white"></rect>
|
65 |
-
# <rect y="69" width="23" height="23" fill="white"></rect>
|
66 |
-
# <rect x="23" width="23" height="23" fill="#AEAEAE"></rect>
|
67 |
-
# <rect x="23" y="69" width="23" height="23" fill="#AEAEAE"></rect>
|
68 |
-
# <rect x="46" width="23" height="23" fill="white"></rect>
|
69 |
-
# <rect x="46" y="69" width="23" height="23" fill="white"></rect>
|
70 |
-
# <rect x="69" width="23" height="23" fill="black"></rect>
|
71 |
-
# <rect x="69" y="69" width="23" height="23" fill="black"></rect>
|
72 |
-
# <rect x="92" width="23" height="23" fill="#D9D9D9"></rect>
|
73 |
-
# <rect x="92" y="69" width="23" height="23" fill="#AEAEAE"></rect>
|
74 |
-
# <rect x="115" y="46" width="23" height="23" fill="white"></rect>
|
75 |
-
# <rect x="115" y="115" width="23" height="23" fill="white"></rect>
|
76 |
-
# <rect x="115" y="69" width="23" height="23" fill="#D9D9D9"></rect>
|
77 |
-
# <rect x="92" y="46" width="23" height="23" fill="#AEAEAE"></rect>
|
78 |
-
# <rect x="92" y="115" width="23" height="23" fill="#AEAEAE"></rect>
|
79 |
-
# <rect x="92" y="69" width="23" height="23" fill="white"></rect>
|
80 |
-
# <rect x="69" y="46" width="23" height="23" fill="white"></rect>
|
81 |
-
# <rect x="69" y="115" width="23" height="23" fill="white"></rect>
|
82 |
-
# <rect x="69" y="69" width="23" height="23" fill="#D9D9D9"></rect>
|
83 |
-
# <rect x="46" y="46" width="23" height="23" fill="black"></rect>
|
84 |
-
# <rect x="46" y="115" width="23" height="23" fill="black"></rect>
|
85 |
-
# <rect x="46" y="69" width="23" height="23" fill="black"></rect>
|
86 |
-
# <rect x="23" y="46" width="23" height="23" fill="#D9D9D9"></rect>
|
87 |
-
# <rect x="23" y="115" width="23" height="23" fill="#AEAEAE"></rect>
|
88 |
-
# <rect x="23" y="69" width="23" height="23" fill="black"></rect>
|
89 |
-
# </svg>
|
90 |
-
# <h1 style="font-weight: 900; margin-bottom: 7px;margin-top:5px">
|
91 |
-
# Stable Diffusion 2.1 Demo
|
92 |
-
# </h1>
|
93 |
-
# </div>
|
94 |
-
# <p style="margin-bottom: 10px; font-size: 94%; line-height: 23px;">
|
95 |
-
# Stable Diffusion 2.1 is the latest text-to-image model from StabilityAI. <a style="text-decoration: underline;" href="https://huggingface.co/spaces/stabilityai/stable-diffusion-1">Access Stable Diffusion 1 Space here</a><br>For faster generation and API
|
96 |
-
# access you can try
|
97 |
-
# <a
|
98 |
-
# href="http://beta.dreamstudio.ai/"
|
99 |
-
# style="text-decoration: underline;"
|
100 |
-
# target="_blank"
|
101 |
-
# >DreamStudio Beta</a
|
102 |
-
# >.</a>
|
103 |
-
# </p>
|
104 |
-
# </div>
|
105 |
-
# """
|
106 |
-
# )
|
107 |
|
108 |
with gr.Box():
|
109 |
|
@@ -113,12 +72,14 @@ with gr.Blocks(css=css) as demo:
|
|
113 |
|
114 |
# with gr.Row():
|
115 |
with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
|
116 |
-
with gr.Column(scale=0.
|
117 |
txt = gr.Textbox(
|
118 |
show_label=False,
|
119 |
placeholder="Type your response and press enter, or record your response",
|
120 |
).style(container=False)
|
121 |
-
with gr.Column(scale=0.
|
|
|
|
|
122 |
submit = gr.Button("Submit")
|
123 |
# gr.Interface(
|
124 |
# fn=transcribe,
|
@@ -131,7 +92,7 @@ with gr.Blocks(css=css) as demo:
|
|
131 |
# "state"
|
132 |
# ],
|
133 |
# live=True)
|
134 |
-
|
135 |
txt.submit(user, [txt, chatbot], [txt, chatbot], queue=False).then(
|
136 |
bot, chatbot, chatbot
|
137 |
)
|
|
|
37 |
}
|
38 |
#chatbot {
|
39 |
min-height: 30rem;
|
40 |
+
margin-bottom: 15px;
|
41 |
+
margin-left: auto;
|
42 |
+
margin-right: auto;
|
43 |
}
|
44 |
"""
|
45 |
|
46 |
with gr.Blocks(css=css) as demo:
|
47 |
|
48 |
+
gr.HTML(
|
49 |
+
"""
|
50 |
+
<div style="text-align: center; margin: 0 auto;">
|
51 |
+
<div
|
52 |
+
style="
|
53 |
+
display: inline-flex;
|
54 |
+
align-items: center;
|
55 |
+
gap: 0.8rem;
|
56 |
+
font-size: 1.75rem;
|
57 |
+
"
|
58 |
+
>
|
59 |
+
<h1 style="font-weight: 900; margin-bottom: 7px;margin-top:5px">
|
60 |
+
Interview with AI (Really?)
|
61 |
+
</h1>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
"""
|
65 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
with gr.Box():
|
68 |
|
|
|
72 |
|
73 |
# with gr.Row():
|
74 |
with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
|
75 |
+
with gr.Column(scale=0.80):
|
76 |
txt = gr.Textbox(
|
77 |
show_label=False,
|
78 |
placeholder="Type your response and press enter, or record your response",
|
79 |
).style(container=False)
|
80 |
+
with gr.Column(scale=0.10, min_width=0):
|
81 |
+
record = gr.Audio(source="microphone", type="filepath", streaming=True)
|
82 |
+
with gr.Column(scale=0.10, min_width=0):
|
83 |
submit = gr.Button("Submit")
|
84 |
# gr.Interface(
|
85 |
# fn=transcribe,
|
|
|
92 |
# "state"
|
93 |
# ],
|
94 |
# live=True)
|
95 |
+
|
96 |
txt.submit(user, [txt, chatbot], [txt, chatbot], queue=False).then(
|
97 |
bot, chatbot, chatbot
|
98 |
)
|