Spaces:
Sleeping
Sleeping
FOrmatting Adjustments
Browse filesRemoved MathJax and added LaTeX delimiters.
app.py
CHANGED
|
@@ -79,22 +79,6 @@ if (document.documentElement) {
|
|
| 79 |
</script>
|
| 80 |
"""
|
| 81 |
|
| 82 |
-
mathjax_config = """
|
| 83 |
-
<script>
|
| 84 |
-
window.MathJax = {
|
| 85 |
-
tex: {
|
| 86 |
-
inlineMath: [['$', '$'], ['\\(', '\\)']],
|
| 87 |
-
displayMath: [['$$', '$$'], ['\\[', '\\]']],
|
| 88 |
-
processEscapes: true,
|
| 89 |
-
processEnvironments: true
|
| 90 |
-
},
|
| 91 |
-
options: {
|
| 92 |
-
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre']
|
| 93 |
-
}
|
| 94 |
-
};
|
| 95 |
-
</script>
|
| 96 |
-
"""
|
| 97 |
-
|
| 98 |
# Environment and Logging Setup
|
| 99 |
def setup_metrics_logger():
|
| 100 |
"""Setup a simple file logger for human-readable metrics"""
|
|
@@ -1043,11 +1027,10 @@ def create_interface():
|
|
| 1043 |
fill_height=True,
|
| 1044 |
theme=gr.themes.Origin()
|
| 1045 |
) as demo:
|
| 1046 |
-
# Add head content
|
| 1047 |
gr.HTML(html_head_content)
|
| 1048 |
gr.HTML(force_light_mode)
|
| 1049 |
-
|
| 1050 |
-
gr.HTML(mathjax_config)
|
| 1051 |
|
| 1052 |
with gr.Column(elem_classes=["main-container"]):
|
| 1053 |
# Title Section
|
|
@@ -1063,7 +1046,11 @@ def create_interface():
|
|
| 1063 |
elem_id="main-chatbot",
|
| 1064 |
container=False,
|
| 1065 |
scale=1,
|
| 1066 |
-
height="70vh"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1067 |
)
|
| 1068 |
|
| 1069 |
# Input Section
|
|
|
|
| 79 |
</script>
|
| 80 |
"""
|
| 81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
# Environment and Logging Setup
|
| 83 |
def setup_metrics_logger():
|
| 84 |
"""Setup a simple file logger for human-readable metrics"""
|
|
|
|
| 1027 |
fill_height=True,
|
| 1028 |
theme=gr.themes.Origin()
|
| 1029 |
) as demo:
|
| 1030 |
+
# Add head content
|
| 1031 |
gr.HTML(html_head_content)
|
| 1032 |
gr.HTML(force_light_mode)
|
| 1033 |
+
|
|
|
|
| 1034 |
|
| 1035 |
with gr.Column(elem_classes=["main-container"]):
|
| 1036 |
# Title Section
|
|
|
|
| 1046 |
elem_id="main-chatbot",
|
| 1047 |
container=False,
|
| 1048 |
scale=1,
|
| 1049 |
+
height="70vh",
|
| 1050 |
+
latex_delimiters=[
|
| 1051 |
+
{"left": "$$", "right": "$$", "display": True}, # For centered display math
|
| 1052 |
+
{"left": "$", "right": "$", "display": False}, # For inline math
|
| 1053 |
+
]
|
| 1054 |
)
|
| 1055 |
|
| 1056 |
# Input Section
|