[GH-ISSUE #1747] Stop Sequence with Backslash '\' Does Not Work #67228

Closed
opened 2026-05-12 23:30:08 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @ibndias on GitHub (Apr 25, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/1747

Bug Report

Stop Sequence with Backslash '' Does Not Work

Description

It seems there is a post process that escape the backslash character. So the final stop sequence produces is incorrect.

Bug Summary:
It seems there is a post process that escape the backslash character. So the final stop sequence produces is incorrect.

Steps to Reproduce:
I am using VLLM Backend.
Open any model, and set stop token on every line break, example set: \n

Expected Behavior:
Stop token should be stay \n instead of becoming \\n

Actual Behavior:
The stop token shown in my inspection is escaped and added another backslash prefix.

Environment

  • Open WebUI Version: v0.1.121
    Ollama Version 0.1.32
  • Operating System: POP OS 22.04]
  • Browser (if applicable): Chrome Version 123.0.6312.105 (Official Build) (64-bit)

Reproduction Details

I am using VLLM Backend.
Open any model, and set stop token on every line break, example set: \n

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.

Logs and Screenshots

image

As we can see the system prompt has no problem handling line break into \n

But the stop sequence becomes \\n instead of just \n

Installation Method

Docker Method

Originally created by @ibndias on GitHub (Apr 25, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/1747 # Bug Report Stop Sequence with Backslash '\' Does Not Work ## Description It seems there is a post process that escape the backslash character. So the final stop sequence produces is incorrect. **Bug Summary:** It seems there is a post process that escape the backslash character. So the final stop sequence produces is incorrect. **Steps to Reproduce:** I am using VLLM Backend. Open any model, and set stop token on every line break, example set: `\n` **Expected Behavior:** Stop token should be stay `\n` instead of becoming `\\n` **Actual Behavior:** The stop token shown in my inspection is escaped and added another backslash prefix. ## Environment - **Open WebUI Version:** v0.1.121 Ollama Version 0.1.32 - **Operating System:** POP OS 22.04] - **Browser (if applicable):** Chrome Version 123.0.6312.105 (Official Build) (64-bit) ## Reproduction Details I am using VLLM Backend. Open any model, and set stop token on every line break, example set: `\n` **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [x] I am on the latest version of both Open WebUI and Ollama. - [x] I have included the browser console logs. - [ ] I have included the Docker container logs. ## Logs and Screenshots ![image](https://github.com/open-webui/open-webui/assets/3958152/9fd1f5e1-2c5b-40cd-9539-a1c86a8c17c4) As we can see the system prompt has no problem handling line break into `\n` But the stop sequence becomes `\\n` instead of just `\n` ## Installation Method Docker Method
Author
Owner

@tjbck commented on GitHub (Apr 27, 2024):

Taking a look!

<!-- gh-comment-id:2081253991 --> @tjbck commented on GitHub (Apr 27, 2024): Taking a look!
Author
Owner

@tjbck commented on GitHub (Apr 28, 2024):

Should be fixed on our dev branch, let me know if the issue persists!

<!-- gh-comment-id:2081267856 --> @tjbck commented on GitHub (Apr 28, 2024): Should be fixed on our dev branch, let me know if the issue persists!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#67228