wwpop commited on
Commit
b974d27
·
verified ·
1 Parent(s): 6706d71

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -42,10 +42,20 @@ def respond(
42
 
43
  # Gradio ChatInterface setup with MathJax
44
  mathjax_script = """
45
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/katex.min.css" integrity="sha384-Um5gpz1odJg5Z4HAmzptBBvMrqERW5Z4icqS+8iu7r5vL20nmpEQ6/6BwYIuL8" crossorigin="anonymous">
46
- <script defer src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.11/katex.min.js" integrity="sha384-YNHdsYkH6gFf146yyNCToHNauALlYwViumE/lp77cA3E2g8VoECF1Sn4aa/n9I" crossorigin="anonymous"></script>
47
- <script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8vo6LrT9HH" crossorigin="anonymous"
48
- onload="renderMathInElement(document.body);"></script>
 
 
 
 
 
 
 
 
 
 
49
  """
50
  demo = gr.ChatInterface(
51
  respond,
 
42
 
43
  # Gradio ChatInterface setup with MathJax
44
  mathjax_script = """
45
+ <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
46
+ <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
47
+ <script>
48
+ document.addEventListener('DOMContentLoaded', function() {
49
+ MathJax = {
50
+ tex: {
51
+ inlineMath: [['$', '$'], ['\$$', '\\)']]
52
+ },
53
+ svg: {
54
+ fontCache: 'global'
55
+ }
56
+ };
57
+ });
58
+ </script>
59
  """
60
  demo = gr.ChatInterface(
61
  respond,