Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -165,31 +165,38 @@ with gr.Blocks(css="""
|
|
| 165 |
}
|
| 166 |
.gr-chatbot { background-color: white; border-radius: 15px; padding: 20px; }
|
| 167 |
.custom-tabs .tab-nav {
|
| 168 |
-
background-color: #
|
| 169 |
-
border-radius:
|
| 170 |
-
padding:
|
| 171 |
display: flex;
|
| 172 |
justify-content: center;
|
|
|
|
|
|
|
|
|
|
| 173 |
}
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
:root {
|
| 194 |
--trim-region-color: rgba(255, 153, 0, 0.5); /* Nice orange for example */
|
| 195 |
|
|
@@ -233,7 +240,7 @@ with gr.Blocks(css="""
|
|
| 233 |
|
| 234 |
gr.Markdown("""
|
| 235 |
<div style='width: 100%; text-align: center;'>
|
| 236 |
-
<img src="https://cdn-uploads.huggingface.co/production/uploads/6841b10b397a67a7c7a39b89/
|
| 237 |
</div>
|
| 238 |
""")
|
| 239 |
#https://cdn-uploads.huggingface.co/production/uploads/6841b10b397a67a7c7a39b89/MTR_dMHte-RCIbyujLW83.png
|
|
@@ -245,6 +252,7 @@ with gr.Blocks(css="""
|
|
| 245 |
|
| 246 |
|
| 247 |
|
|
|
|
| 248 |
user_profile = gr.State({"interview_type": "", "field": "", "interview_in_progress": False})
|
| 249 |
chat_history = gr.State([])
|
| 250 |
|
|
@@ -300,20 +308,20 @@ with gr.Blocks(css="""
|
|
| 300 |
with gr.Column(elem_classes=["custom-tabs"]):
|
| 301 |
with gr.Tabs():
|
| 302 |
|
| 303 |
-
with gr.Tab('
|
| 304 |
chatbot_text = gr.Chatbot(label="Interview Chat (Text Mode)", type="messages")
|
| 305 |
msg = gr.Textbox(label="Type 'start' to begin")
|
| 306 |
send_btn = gr.Button("Send")
|
| 307 |
send_btn.click(respond, inputs=[msg, chat_history, user_profile], outputs=[chatbot_text], queue=False)
|
| 308 |
send_btn.click(lambda: "", None, msg, queue=False)
|
| 309 |
|
| 310 |
-
with gr.Tab("
|
| 311 |
chatbot_audio = gr.Chatbot(label="Interview Chat (Audio Mode)", type="messages")
|
| 312 |
audio_input = gr.Audio(type="filepath", label="Record Your Answer")
|
| 313 |
audio_btn = gr.Button("Send Audio")
|
| 314 |
audio_btn.click(handle_audio, inputs=[audio_input, chat_history, user_profile], outputs=[chatbot_audio], queue=False)
|
| 315 |
|
| 316 |
-
with gr.Tab("
|
| 317 |
img_upload = gr.Image(type="pil", label="Upload an Image")
|
| 318 |
posture_output = gr.Textbox(label="Posture Feedback")
|
| 319 |
posture_btn = gr.Button("Analyze Posture")
|
|
|
|
| 165 |
}
|
| 166 |
.gr-chatbot { background-color: white; border-radius: 15px; padding: 20px; }
|
| 167 |
.custom-tabs .tab-nav {
|
| 168 |
+
background-color: #ffffff;
|
| 169 |
+
border-radius: 50px;
|
| 170 |
+
padding: 8px;
|
| 171 |
display: flex;
|
| 172 |
justify-content: center;
|
| 173 |
+
gap: 8px;
|
| 174 |
+
border: 1px solid #e0e0e0;
|
| 175 |
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
|
| 176 |
}
|
| 177 |
+
|
| 178 |
+
.custom-tabs button[role="tab"] {
|
| 179 |
+
border-radius: 50px !important;
|
| 180 |
+
padding: 10px 30px !important;
|
| 181 |
+
font-weight: 500;
|
| 182 |
+
font-size: 16px;
|
| 183 |
+
color: #555 !important;
|
| 184 |
+
background-color: transparent;
|
| 185 |
+
border: none;
|
| 186 |
+
transition: 0.25s ease;
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
.custom-tabs button[role="tab"][aria-selected="true"] {
|
| 190 |
+
background-color: #b3f0ff;
|
| 191 |
+
color: #222 !important;
|
| 192 |
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
.custom-tabs button[role="tab"]:hover {
|
| 196 |
+
background-color: #e0f7ff;
|
| 197 |
+
transform: scale(1.05);
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
:root {
|
| 201 |
--trim-region-color: rgba(255, 153, 0, 0.5); /* Nice orange for example */
|
| 202 |
|
|
|
|
| 240 |
|
| 241 |
gr.Markdown("""
|
| 242 |
<div style='width: 100%; text-align: center;'>
|
| 243 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6841b10b397a67a7c7a39b89/iudiYIVkr1ZcAqpEWaW3Z.png" style="width: 100%; height: auto; object-fit: contain;">
|
| 244 |
</div>
|
| 245 |
""")
|
| 246 |
#https://cdn-uploads.huggingface.co/production/uploads/6841b10b397a67a7c7a39b89/MTR_dMHte-RCIbyujLW83.png
|
|
|
|
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
+
|
| 256 |
user_profile = gr.State({"interview_type": "", "field": "", "interview_in_progress": False})
|
| 257 |
chat_history = gr.State([])
|
| 258 |
|
|
|
|
| 308 |
with gr.Column(elem_classes=["custom-tabs"]):
|
| 309 |
with gr.Tabs():
|
| 310 |
|
| 311 |
+
with gr.Tab('Text Mode'):
|
| 312 |
chatbot_text = gr.Chatbot(label="Interview Chat (Text Mode)", type="messages")
|
| 313 |
msg = gr.Textbox(label="Type 'start' to begin")
|
| 314 |
send_btn = gr.Button("Send")
|
| 315 |
send_btn.click(respond, inputs=[msg, chat_history, user_profile], outputs=[chatbot_text], queue=False)
|
| 316 |
send_btn.click(lambda: "", None, msg, queue=False)
|
| 317 |
|
| 318 |
+
with gr.Tab("Audio Mode"):
|
| 319 |
chatbot_audio = gr.Chatbot(label="Interview Chat (Audio Mode)", type="messages")
|
| 320 |
audio_input = gr.Audio(type="filepath", label="Record Your Answer")
|
| 321 |
audio_btn = gr.Button("Send Audio")
|
| 322 |
audio_btn.click(handle_audio, inputs=[audio_input, chat_history, user_profile], outputs=[chatbot_audio], queue=False)
|
| 323 |
|
| 324 |
+
with gr.Tab("Webcam Mode"):
|
| 325 |
img_upload = gr.Image(type="pil", label="Upload an Image")
|
| 326 |
posture_output = gr.Textbox(label="Posture Feedback")
|
| 327 |
posture_btn = gr.Button("Analyze Posture")
|