Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -162,6 +162,37 @@ with gr.Blocks(css="""
|
|
| 162 |
transform: scale(1.05);
|
| 163 |
}
|
| 164 |
.gr-chatbot { background-color: white; border-radius: 15px; padding: 20px; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
""") as demo:
|
| 166 |
|
| 167 |
gr.Markdown("""
|
|
@@ -220,24 +251,27 @@ with gr.Blocks(css="""
|
|
| 220 |
|
| 221 |
# Step 3: Chat Mode Tabs
|
| 222 |
gr.Markdown("### Step 3: Choose Chat Mode")
|
| 223 |
-
with gr.
|
| 224 |
-
with gr.
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
|
|
|
|
|
|
|
|
|
| 241 |
|
| 242 |
|
| 243 |
demo.launch()
|
|
|
|
| 162 |
transform: scale(1.05);
|
| 163 |
}
|
| 164 |
.gr-chatbot { background-color: white; border-radius: 15px; padding: 20px; }
|
| 165 |
+
/* CUSTOM TABS DESIGN (only affects Step 3 Tabs) */
|
| 166 |
+
.custom-tabs .gr-tabs {
|
| 167 |
+
background-color: #f9f9f7;
|
| 168 |
+
border-radius: 15px;
|
| 169 |
+
padding: 5px;
|
| 170 |
+
display: flex;
|
| 171 |
+
justify-content: center;
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
.custom-tabs .gr-tab-button {
|
| 175 |
+
border-radius: 12px !important;
|
| 176 |
+
padding: 10px 24px !important;
|
| 177 |
+
margin: 4px !important;
|
| 178 |
+
font-weight: 500;
|
| 179 |
+
font-size: 16px;
|
| 180 |
+
color: #888 !important;
|
| 181 |
+
background-color: #ffffff;
|
| 182 |
+
border: none !important;
|
| 183 |
+
transition: 0.3s ease;
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
.custom-tabs .gr-tab-button.selected {
|
| 187 |
+
background-color: #f0f0eb !important;
|
| 188 |
+
color: #333 !important;
|
| 189 |
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
.custom-tabs .gr-tab-button:hover {
|
| 193 |
+
background-color: #ecece8 !important;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
""") as demo:
|
| 197 |
|
| 198 |
gr.Markdown("""
|
|
|
|
| 251 |
|
| 252 |
# Step 3: Chat Mode Tabs
|
| 253 |
gr.Markdown("### Step 3: Choose Chat Mode")
|
| 254 |
+
with gr.Row():
|
| 255 |
+
with gr.Column(elem_classes=["custom-tabs"]):
|
| 256 |
+
with gr.Tabs():
|
| 257 |
+
with gr.Tab("💬 Text Mode"):
|
| 258 |
+
chatbot_text = gr.Chatbot(label="Interview Chat (Text Mode)", type="messages")
|
| 259 |
+
msg = gr.Textbox(label="Type 'start' to begin")
|
| 260 |
+
send_btn = gr.Button("Send")
|
| 261 |
+
send_btn.click(respond, inputs=[msg, chat_history, user_profile], outputs=[chatbot_text], queue=False)
|
| 262 |
+
send_btn.click(lambda: "", None, msg, queue=False)
|
| 263 |
+
|
| 264 |
+
with gr.Tab("🎙️ Audio Mode"):
|
| 265 |
+
chatbot_audio = gr.Chatbot(label="Interview Chat (Audio Mode)", type="messages")
|
| 266 |
+
audio_input = gr.Audio(type="filepath", label="Record Your Answer")
|
| 267 |
+
audio_btn = gr.Button("Send Audio")
|
| 268 |
+
audio_btn.click(handle_audio, inputs=[audio_input, chat_history, user_profile], outputs=[chatbot_audio], queue=False)
|
| 269 |
+
|
| 270 |
+
with gr.Tab("📸 Webcam Mode"):
|
| 271 |
+
img_upload = gr.Image(source="webcam", type="pil", label="Capture Posture")
|
| 272 |
+
posture_output = gr.Textbox(label="Posture Feedback")
|
| 273 |
+
posture_btn = gr.Button("Analyze Posture")
|
| 274 |
+
posture_btn.click(classify_image, inputs=[img_upload], outputs=[posture_output])
|
| 275 |
|
| 276 |
|
| 277 |
demo.launch()
|