Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -103,18 +103,20 @@ def predict(user_input, history, access_granted):
|
|
| 103 |
return history, ""
|
| 104 |
|
| 105 |
with gr.Blocks(theme, css="""
|
| 106 |
-
#chatbot {
|
| 107 |
-
.gradio-container { height:
|
| 108 |
#component-0 { height: 100%; }
|
|
|
|
| 109 |
footer { display: none !important; }
|
| 110 |
-
.message-wrap { overflow-y: auto !important; max-height: none !important; }
|
| 111 |
-
.chat-wrap { max-height: none !important; }
|
| 112 |
-
.scroll-hide { max-height: none !important; }
|
| 113 |
#submit-btn { margin-top: 10px; }
|
| 114 |
#code_submit {
|
| 115 |
height: 50px !important;
|
| 116 |
font-size: 1.2em !important;
|
| 117 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
@media (max-width: 600px) {
|
| 119 |
#code_submit {
|
| 120 |
height: 60px !important;
|
|
@@ -129,20 +131,20 @@ with gr.Blocks(theme, css="""
|
|
| 129 |
access_granted = gr.State(False)
|
| 130 |
|
| 131 |
with gr.Tab("Access"):
|
| 132 |
-
gr.
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
|
|
|
| 136 |
|
| 137 |
with gr.Tab("Chat"):
|
| 138 |
-
chatbot = gr.Chatbot(label="Conversation",
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
submit = gr.Button("Submit", interactive=False, scale=0.15)
|
| 146 |
|
| 147 |
def submit_code(code, access_granted):
|
| 148 |
success, _, _, message = verify_code(code, access_granted)
|
|
|
|
| 103 |
return history, ""
|
| 104 |
|
| 105 |
with gr.Blocks(theme, css="""
|
| 106 |
+
#chatbot { flex-grow: 1; height: 460px; overflow-y: auto; }
|
| 107 |
+
.gradio-container { height: 680px; max-width: 100% !important; padding: 0 !important; }
|
| 108 |
#component-0 { height: 100%; }
|
| 109 |
+
#component-3 { height: calc(100% - 250px); }
|
| 110 |
footer { display: none !important; }
|
|
|
|
|
|
|
|
|
|
| 111 |
#submit-btn { margin-top: 10px; }
|
| 112 |
#code_submit {
|
| 113 |
height: 50px !important;
|
| 114 |
font-size: 1.2em !important;
|
| 115 |
}
|
| 116 |
+
/* Add these new rules here */
|
| 117 |
+
.message-wrap { max-height: 300px !important; overflow-y: auto !important; }
|
| 118 |
+
.chat-wrap { max-height: 400px !important; overflow-y: auto !important; }
|
| 119 |
+
.gradio-container { height: auto !important; min-height: 0 !important; }
|
| 120 |
@media (max-width: 600px) {
|
| 121 |
#code_submit {
|
| 122 |
height: 60px !important;
|
|
|
|
| 131 |
access_granted = gr.State(False)
|
| 132 |
|
| 133 |
with gr.Tab("Access"):
|
| 134 |
+
with gr.Tab("Access"):
|
| 135 |
+
gr.Markdown("Enter the Access Code displayed in the upper-left corner.")
|
| 136 |
+
code_input = gr.Textbox(label="Access Code", type="text", placeholder="Enter CODE here...")
|
| 137 |
+
code_submit = gr.Button("Submit Code", elem_id="code_submit")
|
| 138 |
+
code_message = gr.Label(label="Status", elem_id="code_message")
|
| 139 |
|
| 140 |
with gr.Tab("Chat"):
|
| 141 |
+
chatbot = gr.Chatbot(label="Conversation", height=340) # Adjust the height as needed
|
| 142 |
+
msg = gr.Textbox(
|
| 143 |
+
label=f"Chat with {coach_name_short}",
|
| 144 |
+
placeholder="Type your message here... (MAX: 1000 characters)",
|
| 145 |
+
interactive=False
|
| 146 |
+
)
|
| 147 |
+
submit = gr.Button("Submit Message", interactive=False)
|
|
|
|
| 148 |
|
| 149 |
def submit_code(code, access_granted):
|
| 150 |
success, _, _, message = verify_code(code, access_granted)
|