virtUOS / kiwi

A simple and configurable portal to proxy to llms.
https://virtuos.github.io/kiwi/
GNU Affero General Public License v3.0
2 stars 3 forks source link

Render latex formulas in chat area responses #36

Closed Odrec closed 3 months ago

Odrec commented 3 months ago

Right now math formulas show up like this in the chat area

image

It would be nice to render them as latex. Streamlit already provides a simple way to do this using st.latex but since we render the answers from the model using streaming it's difficult to realize when we have a latex formula.

We need a way to detect a latex formula is being written and wait for it to finish before rendering it with st.latex.

Odrec commented 3 months ago

Needs a bit more testing. Sometimes the model crashes with a None value during the parsing process.