mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-28 06:22:33 +00:00
fix: a stop sequence with a % sign no longer stops every message from sending (#32649)
This commit is contained in:
parent
07dffea1ef
commit
fdb304be2f
1 changed files with 7 additions and 3 deletions
|
|
@ -4138,9 +4138,13 @@
|
|||
|
||||
const tokens = Array.isArray(stop) ? stop : stop.split(',').map((s) => s.trim());
|
||||
|
||||
return tokens
|
||||
.filter(Boolean)
|
||||
.map((token) => decodeURIComponent(JSON.parse(`"${token.replace(/"/g, '\\"')}"`)));
|
||||
return tokens.filter(Boolean).map((token) => {
|
||||
try {
|
||||
return decodeURIComponent(JSON.parse(`"${token.replace(/"/g, '\\"')}"`));
|
||||
} catch {
|
||||
return token;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const sendMessageSocket = async (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue