[GH-ISSUE #828] math output is not format correctly #115538

Closed
opened 2026-05-20 17:18:55 -05:00 by GiteaMirror · 9 comments
Owner

Originally created by @elvis-cai on GitHub (Feb 21, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/828

Environment

  • Operating System: Mac sonoma14.2.1
  • Browser (if applicable): Version 121.0.6167.184 (Official Build) (arm64)

Description

math output is not format correctly

when ask question if a book contains 127,000 tokens, how many pages does it typically have?
it's outputting

[ \text{Number of pages} = \frac{\text{Total words}}{\text{Words per page}} = \frac{127,000}{250} = 508 ]

WechatIMG224

Tested with latest version ghcr.io/open-webui/open-webui@sha256:7d43ed0ff523046c6e2b31e0e7274a64570ed66daa7789e2bc1d9a72f1f9b226

let me know if anything I am missing, thank you.

Originally created by @elvis-cai on GitHub (Feb 21, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/828 ## Environment - **Operating System:** Mac sonoma14.2.1 - **Browser (if applicable):** Version 121.0.6167.184 (Official Build) (arm64) ## Description math output is not format correctly when ask question `if a book contains 127,000 tokens, how many pages does it typically have?` it's outputting ``` [ \text{Number of pages} = \frac{\text{Total words}}{\text{Words per page}} = \frac{127,000}{250} = 508 ] ``` ![WechatIMG224](https://github.com/open-webui/open-webui/assets/38489894/cd74c995-bb5a-452e-ae12-f908748460c0) Tested with latest version `ghcr.io/open-webui/open-webui@sha256:7d43ed0ff523046c6e2b31e0e7274a64570ed66daa7789e2bc1d9a72f1f9b226` let me know if anything I am missing, thank you.
Author
Owner

@jannikstdl commented on GitHub (Feb 21, 2024):

This is not Open WebUI's fault since the output comes directly from the LLM. LLMs are generally not good at math.

In future this could trigger something like a python runner like ChatGPT does.

<!-- gh-comment-id:1956563373 --> @jannikstdl commented on GitHub (Feb 21, 2024): This is not Open WebUI's fault since the output comes directly from the LLM. LLMs are generally not good at math. In future this could trigger something like a python runner like ChatGPT does.
Author
Owner

@AgatheBauer commented on GitHub (Feb 21, 2024):

I think this isn't the problem which @elvis-cai wanted to report @jannikstdl.
The frontend doesn't recognize the Latex format. I'm affected too.

<!-- gh-comment-id:1956990920 --> @AgatheBauer commented on GitHub (Feb 21, 2024): I think this isn't the problem which @elvis-cai wanted to report @jannikstdl. The frontend doesn't recognize the Latex format. I'm affected too.
Author
Owner

@justinh-rahb commented on GitHub (Feb 21, 2024):

I think this isn't the problem which @elvis-cai wanted to report @jannikstdl. The frontend doesn't recognize the Latex format. I'm affected too.

This makes more sense and should be fixable, whether the equations will be correct is another matter though lol ☝️

<!-- gh-comment-id:1957016473 --> @justinh-rahb commented on GitHub (Feb 21, 2024): > I think this isn't the problem which @elvis-cai wanted to report @jannikstdl. The frontend doesn't recognize the Latex format. I'm affected too. This makes more sense and should be fixable, whether the equations will be correct is another matter though lol ☝️
Author
Owner

@jannikstdl commented on GitHub (Feb 21, 2024):

I think this isn't the problem which @elvis-cai wanted to report @jannikstdl.

The frontend doesn't recognize the Latex format. I'm affected too.

Ah got it! This should look like this
image

<!-- gh-comment-id:1957838198 --> @jannikstdl commented on GitHub (Feb 21, 2024): > I think this isn't the problem which @elvis-cai wanted to report @jannikstdl. > > The frontend doesn't recognize the Latex format. I'm affected too. Ah got it! This should look like this ![image](https://github.com/open-webui/open-webui/assets/69747628/6f936961-9ebc-4025-b41a-56058e5ee019)
Author
Owner

@jannikstdl commented on GitHub (Feb 21, 2024):

But wasn't this a false declaration at all?

[ \text{Number of pages} = \frac{\text{Total words}}{\text{Words per page}} = \frac{127,000}{250} = 508 ]

Like this should be \[...\] I think?

<!-- gh-comment-id:1957946365 --> @jannikstdl commented on GitHub (Feb 21, 2024): But wasn't this a false declaration at all? `[ \text{Number of pages} = \frac{\text{Total words}}{\text{Words per page}} = \frac{127,000}{250} = 508 ]` Like this should be `\[...\]` I think?
Author
Owner

@tjbck commented on GitHub (Feb 21, 2024):

@jannikstdl it is indeed, but I just added [ and ] (with extra space) to be considered as delimiters. I'll remove this later if it causes more issues than good.

<!-- gh-comment-id:1957997703 --> @tjbck commented on GitHub (Feb 21, 2024): @jannikstdl it is indeed, but I just added `[ ` and ` ]` (with extra space) to be considered as delimiters. I'll remove this later if it causes more issues than good.
Author
Owner

@elvis-cai commented on GitHub (Feb 21, 2024):

Thanks @tjbck, @jannikstdl for the quick fix🙇

<!-- gh-comment-id:1958022639 --> @elvis-cai commented on GitHub (Feb 21, 2024): Thanks @tjbck, @jannikstdl for the quick fix🙇
Author
Owner

@tracer123 commented on GitHub (Feb 27, 2024):

Below is another example of this formatting issue.

0WJQa7b

<!-- gh-comment-id:1967398584 --> @tracer123 commented on GitHub (Feb 27, 2024): Below is another example of this formatting issue. ![0WJQa7b](https://github.com/open-webui/open-webui/assets/1967036/7650851b-f77e-425a-b2e7-82c2deff8f24)
Author
Owner

@hxypqr commented on GitHub (Apr 25, 2024):

There is a parity issue here, and we need to find a mapping method to move the part of the text that may be output by LLM out of the dollar signs in Latex in order to display it normally.

<!-- gh-comment-id:2076132459 --> @hxypqr commented on GitHub (Apr 25, 2024): There is a parity issue here, and we need to find a mapping method to move the part of the text that may be output by LLM out of the dollar signs in Latex in order to display it normally.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#115538