Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -128,10 +128,6 @@ def render_message(history):
|
|
| 128 |
</div>"""
|
| 129 |
|
| 130 |
if assistant_message:
|
| 131 |
-
assistant_message_html = markdown.markdown(
|
| 132 |
-
assistant_message, extensions=["fenced_code", CodeHiliteExtension()]
|
| 133 |
-
)
|
| 134 |
-
assistant_message_html = markdown.markdown(escape_html(assistant_message), extensions=["fenced_code", "codehilite"])
|
| 135 |
messages_html += f"""
|
| 136 |
<div style='display: flex; align-items: center; margin-bottom: 10px;'>
|
| 137 |
<img src='{assistant_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;'>
|
|
@@ -168,19 +164,10 @@ with gr.Blocks(css=css) as demo:
|
|
| 168 |
<script type="text/javascript" id="MathJax-script" async
|
| 169 |
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js">
|
| 170 |
</script>
|
| 171 |
-
<script>
|
| 172 |
-
if (typeof MathJax !== 'undefined') {
|
| 173 |
-
MathJax.typesetPromise()
|
| 174 |
-
.then(() => console.log("MathJax typesetting complete."))
|
| 175 |
-
.catch((err) => console.error("MathJax typesetting error:", err));
|
| 176 |
-
} else {
|
| 177 |
-
console.error("MathJax is not loaded.");
|
| 178 |
-
}
|
| 179 |
-
</script>
|
| 180 |
""")
|
| 181 |
gr.Markdown("## P-MSQ Chat Interface")
|
| 182 |
chatbot_output = gr.HTML(elem_id="chatbox-container")
|
| 183 |
-
|
| 184 |
msg_input = gr.Text(
|
| 185 |
show_label=False,
|
| 186 |
placeholder="Type your message and press Shift+Enter...",
|
|
|
|
| 128 |
</div>"""
|
| 129 |
|
| 130 |
if assistant_message:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
messages_html += f"""
|
| 132 |
<div style='display: flex; align-items: center; margin-bottom: 10px;'>
|
| 133 |
<img src='{assistant_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;'>
|
|
|
|
| 164 |
<script type="text/javascript" id="MathJax-script" async
|
| 165 |
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js">
|
| 166 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
""")
|
| 168 |
gr.Markdown("## P-MSQ Chat Interface")
|
| 169 |
chatbot_output = gr.HTML(elem_id="chatbox-container")
|
| 170 |
+
gr.Markdown(elem_id="chatbox-container")
|
| 171 |
msg_input = gr.Text(
|
| 172 |
show_label=False,
|
| 173 |
placeholder="Type your message and press Shift+Enter...",
|