POLRAMBORA commited on
Commit
e35061d
·
verified ·
1 Parent(s): 66fb104

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -3
app.py CHANGED
@@ -156,8 +156,13 @@ function HTMLClean() {
156
  alert("This page is in-dev stage, expect lots of restarts, the interface is open-sourced (not the backend that is responsible for API Keys)")
157
  }
158
  """
159
-
160
- with gr.Blocks(css=".chatbox {height: 400px; overflow: auto; border: 1px solid #262626; padding: 10px; background-color: #171717; display: flex; flex-direction: column-reverse;}", js=js) as demo:
 
 
 
 
 
161
 
162
  with gr.Column(visible=True) as auth_view:
163
  gr.Markdown("## P-MSQ Authorization")
@@ -169,7 +174,37 @@ with gr.Blocks(css=".chatbox {height: 400px; overflow: auto; border: 1px solid #
169
 
170
  with gr.Column(visible=False) as chat_view:
171
  gr.Markdown("## P-MSQ Chat Interface")
172
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  chatbot_output = gr.HTML(elem_id="chatbox-container")
174
 
175
  msg_input = gr.Text(
 
156
  alert("This page is in-dev stage, expect lots of restarts, the interface is open-sourced (not the backend that is responsible for API Keys)")
157
  }
158
  """
159
+ css="""
160
+ .chatbox {height: 400px; overflow: auto; border: 1px solid #262626; padding: 10px; background-color: #171717; display: flex; flex-direction: column-reverse;}
161
+ #chatbox-container .katex-display { display: inline; }
162
+ #chatbox-container .katex-display>.katex { display: inline; }
163
+ #chatbox-container .katex-display>.katex>.katex-html { display: inline; }
164
+ """
165
+ with gr.Blocks(css=css, js=js) as demo:
166
 
167
  with gr.Column(visible=True) as auth_view:
168
  gr.Markdown("## P-MSQ Authorization")
 
174
 
175
  with gr.Column(visible=False) as chat_view:
176
  gr.Markdown("## P-MSQ Chat Interface")
177
+ gr.Markdown(label="answer",
178
+ latex_delimiters=[{
179
+ "left": "\\(",
180
+ "right": "\\)",
181
+ "display": True
182
+ }, {
183
+ "left": "\\begin\{equation\}",
184
+ "right": "\\end\{equation\}",
185
+ "display": True
186
+ }, {
187
+ "left": "\\begin\{align\}",
188
+ "right": "\\end\{align\}",
189
+ "display": True
190
+ }, {
191
+ "left": "\\begin\{alignat\}",
192
+ "right": "\\end\{alignat\}",
193
+ "display": True
194
+ }, {
195
+ "left": "\\begin\{gather\}",
196
+ "right": "\\end\{gather\}",
197
+ "display": True
198
+ }, {
199
+ "left": "\\begin\{CD\}",
200
+ "right": "\\end\{CD\}",
201
+ "display": True
202
+ }, {
203
+ "left": "\\[",
204
+ "right": "\\]",
205
+ "display": True
206
+ }],
207
+ elem_id="chatbox-container")
208
  chatbot_output = gr.HTML(elem_id="chatbox-container")
209
 
210
  msg_input = gr.Text(