DeepMount00 commited on
Commit
cba619e
โ€ข
1 Parent(s): ced5932

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +59 -10
app.py CHANGED
@@ -19,15 +19,63 @@ DESCRIPTION = """\
19
  # Lexora 7B ITA ๐Ÿ’ฌ ๐Ÿ‡ฎ๐Ÿ‡น
20
  """
21
 
22
- # Custom CSS to fix chat visualization
23
  CUSTOM_CSS = """
24
- .contain { display: flex; flex-direction: column; }
25
- #component-0 { height: calc(100vh - 100px); overflow-y: auto; }
26
- .chat { height: 100%; }
27
- .message-wrap { max-height: none !important; }
28
- .message { padding: 15px !important; margin: 5px !important; }
29
- .user-message { background-color: #f0f0f0 !important; }
30
- .bot-message { background-color: #e3f2fd !important; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  """
32
 
33
  MAX_MAX_NEW_TOKENS = 2048
@@ -148,11 +196,12 @@ chat_interface = gr.ChatInterface(
148
  cache_examples=False,
149
  )
150
 
151
- with gr.Blocks(css=CUSTOM_CSS, fill_height=True, theme=gr.themes.Soft()) as demo:
152
  with gr.Column(elem_classes="contain"):
153
  gr.Markdown(DESCRIPTION)
154
  gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
155
- chat_interface.render()
 
156
 
157
  if __name__ == "__main__":
158
  demo.queue(max_size=20).launch()
 
19
  # Lexora 7B ITA ๐Ÿ’ฌ ๐Ÿ‡ฎ๐Ÿ‡น
20
  """
21
 
22
+ # Updated CSS to ensure full height and proper scrolling
23
  CUSTOM_CSS = """
24
+ .gradio-container {
25
+ height: 100vh !important;
26
+ max-height: 100vh !important;
27
+ padding: 0 !important;
28
+ background-color: #0f1117;
29
+ }
30
+
31
+ .contain {
32
+ height: 100vh !important;
33
+ max-height: 100vh !important;
34
+ display: flex;
35
+ flex-direction: column;
36
+ }
37
+
38
+ .main-container {
39
+ flex-grow: 1;
40
+ height: calc(100vh - 100px) !important;
41
+ overflow: hidden !important;
42
+ }
43
+
44
+ .chat-container {
45
+ height: 100% !important;
46
+ overflow: hidden !important;
47
+ display: flex;
48
+ flex-direction: column;
49
+ }
50
+
51
+ .chat-messages {
52
+ flex-grow: 1;
53
+ overflow-y: auto !important;
54
+ padding: 1rem;
55
+ }
56
+
57
+ .message-wrap {
58
+ height: auto !important;
59
+ max-height: none !important;
60
+ }
61
+
62
+ .message {
63
+ padding: 1rem !important;
64
+ margin: 0.5rem 0 !important;
65
+ border-radius: 0.5rem !important;
66
+ }
67
+
68
+ .user-message {
69
+ background-color: #2b2d31 !important;
70
+ }
71
+
72
+ .bot-message {
73
+ background-color: #1e1f23 !important;
74
+ }
75
+
76
+ .examples-container {
77
+ margin-top: auto;
78
+ }
79
  """
80
 
81
  MAX_MAX_NEW_TOKENS = 2048
 
196
  cache_examples=False,
197
  )
198
 
199
+ with gr.Blocks(css=CUSTOM_CSS, fill_height=True, theme=gr.themes.Base()) as demo:
200
  with gr.Column(elem_classes="contain"):
201
  gr.Markdown(DESCRIPTION)
202
  gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
203
+ with gr.Column(elem_classes="main-container"):
204
+ chat_interface.render()
205
 
206
  if __name__ == "__main__":
207
  demo.queue(max_size=20).launch()