Skip to content
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

Web UI mis-interprets symbols in code elements as Markdown formatting #317

Closed
c-mart opened this issue Apr 2, 2024 · 1 comment · Fixed by #352
Closed

Web UI mis-interprets symbols in code elements as Markdown formatting #317

c-mart opened this issue Apr 2, 2024 · 1 comment · Fixed by #352

Comments

@c-mart
Copy link

c-mart commented Apr 2, 2024

In the chat web UI, underscores (_) are treated as italicized text delimiters, even within code spans and blocks where they should not affect formatting. I've also observed this with asterisks (*).

I'm running ./mixtral-8x7b-instruct-v0.1.Q5_K_M.llamafile (but LLaVA does the same thing) with 100% default settings. My first chat message is

What does the mysql function `FIND_IN_SET()` do?

The result looks like this, with missing underscores and text between them italicized.

image

This makes it harder to use llamafile for programming assistance.

mrdomino added a commit to mrdomino/llamafile that referenced this issue Apr 22, 2024
Both matchers are now constrained so that they will only be transformed
if the left-hand characters are the start of the text or preceeded by
whitespace, and the right-hand characters are the end of the text or
followed by whitespace or a punctuation mark.

This misses some cases, e.g. emphasis inside of parantheticals, but has
better behavior with e.g. underscores in function names outside of code
blocks.

Fixes Mozilla-Ocho#317.
mrdomino added a commit to mrdomino/llamafile that referenced this issue Apr 22, 2024
Both matchers are now constrained so that they will only be transformed
if the left-hand characters are the start of the text or preceeded by
whitespace, and the right-hand characters are the end of the text or
followed by whitespace or a punctuation mark.

This misses some cases, e.g. emphasis inside of parantheticals, but has
better behavior with e.g. underscores in function names outside of code
blocks.

Fixes Mozilla-Ocho#317.
@github12101
Copy link

Confirming. I am using mixtral-8x7b-instruct-v0.1.Q5_K_M.llamafile, and also observed that asterisks (* symbol) were deleted by chat UI from mathematic equation as AI was going along and printing, and text has been emboldened instead of displaying asterisk in the equation.

image

@jart jart closed this as completed in #352 May 6, 2024
jart pushed a commit that referenced this issue May 6, 2024
Both matchers are now constrained so that they will only be transformed
if the left-hand characters are the start of the text or preceeded by
whitespace, and the right-hand characters are the end of the text or
followed by whitespace or a punctuation mark.

This misses some cases, e.g. emphasis inside of parantheticals, but has
better behavior with e.g. underscores in function names outside of code
blocks.

Fixes #317.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants