mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
Latex not getting rendered properly #156
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jukofyork on GitHub (Jan 7, 2024).
Some Latex seems to get rendered but most doesn't seem to work, eg:
or any use of
$...$for expressions.@tjbck commented on GitHub (Jan 7, 2024):
Hi, Thanks for creating this issue! The issue stems from LLMs not generating LaTeX in a correct format. You can also observe the same problem with ChatGPT like such:
I'll try to see if there are any quick fixes to handle those edge cases, but I'll close this as not planned for now, Thanks!
@tjbck commented on GitHub (Jan 7, 2024):
Just updated the UI rendering logic, I can't guarantee that the UI will render LaTeX 100% of the time as per the reason mentioned above, but it should cover more edge cases than before, Thanks!
@YangSJ1 commented on GitHub (Jun 30, 2024):
Still it sometimes can't render latex properly, even when the expressions are in $$.
@jukofyork commented on GitHub (Jun 30, 2024):
I've figured out this so far:
If the model outputs like this:
or this:
It won't display correctly.
But it can display:
It also seems able to use
\\( <expression \\)for inline expressions or:BUT only if you double escape the
\symbols!I haven't found a way yet to get it to display
$ <expression> $though, and sometimes it will try to indent the non-inline version and that seems to screw up too...I found this out by asking
GPT-4oto try lots of different versions, but sadly however much I tried; I couldn't find a system message that actually encourages models to use this format and they will nearly always just revert to the broken format until you remind them 😦