mirror of
https://github.com/open-webui/open-webui
synced 2025-06-23 02:16:52 +00:00
fix: sanatizeResponseContent for stop token display
This commit is contained in:
parent
3b70841a7d
commit
898b65a653
@ -83,9 +83,9 @@ export const sanitizeResponseContent = (content: string) => {
|
|||||||
.replace(/<\|[a-z]*$/, '')
|
.replace(/<\|[a-z]*$/, '')
|
||||||
.replace(/<\|[a-z]+\|$/, '')
|
.replace(/<\|[a-z]+\|$/, '')
|
||||||
.replace(/<$/, '')
|
.replace(/<$/, '')
|
||||||
.replaceAll(/<\|[a-z]+\|>/g, ' ')
|
|
||||||
.replaceAll('<', '<')
|
.replaceAll('<', '<')
|
||||||
.replaceAll('>', '>')
|
.replaceAll('>', '>')
|
||||||
|
.replaceAll(/<\|[a-z]+\|>/g, ' ')
|
||||||
.trim();
|
.trim();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -361,9 +361,9 @@ export const generateInitialsImage = (name) => {
|
|||||||
const initials =
|
const initials =
|
||||||
sanitizedName.length > 0
|
sanitizedName.length > 0
|
||||||
? sanitizedName[0] +
|
? sanitizedName[0] +
|
||||||
(sanitizedName.split(' ').length > 1
|
(sanitizedName.split(' ').length > 1
|
||||||
? sanitizedName[sanitizedName.lastIndexOf(' ') + 1]
|
? sanitizedName[sanitizedName.lastIndexOf(' ') + 1]
|
||||||
: '')
|
: '')
|
||||||
: '';
|
: '';
|
||||||
|
|
||||||
ctx.fillText(initials.toUpperCase(), canvas.width / 2, canvas.height / 2);
|
ctx.fillText(initials.toUpperCase(), canvas.width / 2, canvas.height / 2);
|
||||||
@ -514,10 +514,10 @@ export const compareVersion = (latest, current) => {
|
|||||||
return current === '0.0.0'
|
return current === '0.0.0'
|
||||||
? false
|
? false
|
||||||
: current.localeCompare(latest, undefined, {
|
: current.localeCompare(latest, undefined, {
|
||||||
numeric: true,
|
numeric: true,
|
||||||
sensitivity: 'case',
|
sensitivity: 'case',
|
||||||
caseFirst: 'upper'
|
caseFirst: 'upper'
|
||||||
}) < 0;
|
}) < 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const extractCurlyBraceWords = (text) => {
|
export const extractCurlyBraceWords = (text) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user