Spaces:
PhilSpiel
/
Sleeping

PhilSpiel commited on
Commit
89e6651
·
verified ·
1 Parent(s): 0a43e1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -17
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 { height: calc(100% - 100px) !important; overflow-y: auto; }
107
- .gradio-container { height: 100vh; max-width: 100% !important; padding: 0 !important; }
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.Markdown("Enter the Access Code displayed in the upper-left corner.")
133
- code_input = gr.Textbox(label="Access Code", type="text", placeholder="Enter CODE here...")
134
- code_submit = gr.Button("Submit Code", elem_id="code_submit")
135
- code_message = gr.Label(label="Status", elem_id="code_message")
 
136
 
137
  with gr.Tab("Chat"):
138
- chatbot = gr.Chatbot(label="Conversation", elem_id="chatbot", height=340)
139
- with gr.Row():
140
- msg = gr.Textbox(
141
- label=f"Chat with {coach_name_short}",
142
- placeholder="Type your message here... (MAX: 1000 characters)",
143
- interactive=False
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)