Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems with math output #3122

Closed
philschrad opened this issue Jun 13, 2024 · 1 comment
Closed

problems with math output #3122

philschrad opened this issue Jun 13, 2024 · 1 comment

Comments

@philschrad
Copy link

philschrad commented Jun 13, 2024

Bug Summary:
math output not rendering correctly

Steps to Reproduce:
ask gpt4, for example:

repeat after me: The transformation matrix for a rotation by an angle \(\theta\) counterclockwise is given by:

\[
\begin{pmatrix}
\cos(\theta) & -\sin(\theta) \\
\sin(\theta) & \cos(\theta)
\end{pmatrix}
\]

(this is also part of the response if you just ask for the transformation matrix)

Expected Behavior:
The math should display correctly, i.e. the greek letter theta and a two by two matrix.

Actual Behavior:
When displayed, the backslashes on the math delimiters \[ \] and \( \) just disappear, and then the latex does not render. By editing the response I have also noticed the following behaviour:

  • double dollar signs work as inline math delimiters but single ones do not unless they are given whitespace, which for the single ones I think is not typical usage
    - \[ and \] work as inline delimiters only if given whitespace.
    - \\[ ... \\] and \\( ... \\) work as inline delimiters (without whitespace) but are not typical outputs from gpt?
  • none of the delimiters work over multiple lines, like the code for the matrix above, I think this is because in here all the delimiters are set with display: false. It would be good to have at least one way of rendering displayed equations.
  • even when the above code for the matrix is changed to be inline with working delimiters, it will display a row vector instead of a 2 by 2 matrix because the double backslash somehow gets ignored (unless I change it to a triple backlash).

Environment

  • Open WebUI Version: not sure, whichever one installs when you follow the docker installation for OpenAI API usage only from here
  • Operating System: [macOS Sonoma]
  • Browser (if applicable): [Safari]
@AlanRvk
Copy link

AlanRvk commented Jun 13, 2024

It's a problem with multiline latex, I don't why but as a temporary solution I ask in the system prompts to only make single line latex, but the matrices and such wont work

@open-webui open-webui locked and limited conversation to collaborators Jun 13, 2024
@tjbck tjbck converted this issue into discussion #3127 Jun 13, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants