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 ]
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 ]
```

Tested with latest version `ghcr.io/open-webui/open-webui@sha256:7d43ed0ff523046c6e2b31e0e7274a64570ed66daa7789e2bc1d9a72f1f9b226`
let me know if anything I am missing, thank you.
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.
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.
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 ☝️
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
<!-- 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

[ \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?
@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.
Below is another example of this formatting issue.
<!-- gh-comment-id:1967398584 -->
@tracer123 commented on GitHub (Feb 27, 2024):
Below is another example of this formatting issue.

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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @elvis-cai on GitHub (Feb 21, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/828
Environment
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
Tested with latest version
ghcr.io/open-webui/open-webui@sha256:7d43ed0ff523046c6e2b31e0e7274a64570ed66daa7789e2bc1d9a72f1f9b226let me know if anything I am missing, thank you.
@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.
@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.
@justinh-rahb commented on GitHub (Feb 21, 2024):
This makes more sense and should be fixable, whether the equations will be correct is another matter though lol ☝️
@jannikstdl commented on GitHub (Feb 21, 2024):
Ah got it! This should look like this

@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?@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.@elvis-cai commented on GitHub (Feb 21, 2024):
Thanks @tjbck, @jannikstdl for the quick fix🙇
@tracer123 commented on GitHub (Feb 27, 2024):
Below is another example of this formatting issue.
@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.