Spaces:
Sleeping
Sleeping
DeepMount00
commited on
Commit
โข
ced5932
1
Parent(s):
1ac23c7
Update app.py
Browse files
app.py
CHANGED
@@ -19,6 +19,17 @@ DESCRIPTION = """\
|
|
19 |
# Lexora 7B ITA ๐ฌ ๐ฎ๐น
|
20 |
"""
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
MAX_MAX_NEW_TOKENS = 2048
|
23 |
DEFAULT_MAX_NEW_TOKENS = 1024
|
24 |
MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
@@ -137,10 +148,11 @@ chat_interface = gr.ChatInterface(
|
|
137 |
cache_examples=False,
|
138 |
)
|
139 |
|
140 |
-
with gr.Blocks(css=
|
141 |
-
gr.
|
142 |
-
|
143 |
-
|
|
|
144 |
|
145 |
if __name__ == "__main__":
|
146 |
demo.queue(max_size=20).launch()
|
|
|
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
|
34 |
DEFAULT_MAX_NEW_TOKENS = 1024
|
35 |
MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
|
|
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()
|