mirror of
https://github.com/open-webui/open-webui
synced 2025-06-16 19:31:52 +00:00
switched nodejs runtime
This commit is contained in:
parent
0810a0158e
commit
2b7e88d728
@ -466,7 +466,7 @@ export const getPipelinesList = async (token: string = '') => {
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
let pipelines = res?.data ?? [];
|
const pipelines = res?.data ?? [];
|
||||||
return pipelines;
|
return pipelines;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -609,7 +609,7 @@ export const getPipelines = async (token: string, urlIdx?: string) => {
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
let pipelines = res?.data ?? [];
|
const pipelines = res?.data ?? [];
|
||||||
return pipelines;
|
return pipelines;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ export const generateTextCompletion = async (token: string = '', model: string,
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const generateChatCompletion = async (token: string = '', body: object) => {
|
export const generateChatCompletion = async (token: string = '', body: object) => {
|
||||||
let controller = new AbortController();
|
const controller = new AbortController();
|
||||||
let error = null;
|
let error = null;
|
||||||
|
|
||||||
const res = await fetch(`${OLLAMA_API_BASE_URL}/api/chat`, {
|
const res = await fetch(`${OLLAMA_API_BASE_URL}/api/chat`, {
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
const devices = await navigator.mediaDevices.enumerateDevices();
|
const devices = await navigator.mediaDevices.enumerateDevices();
|
||||||
videoInputDevices = devices.filter((device) => device.kind === 'videoinput');
|
videoInputDevices = devices.filter((device) => device.kind === 'videoinput');
|
||||||
|
|
||||||
if (!!navigator.mediaDevices.getDisplayMedia) {
|
if (navigator.mediaDevices.getDisplayMedia) {
|
||||||
videoInputDevices = [
|
videoInputDevices = [
|
||||||
...videoInputDevices,
|
...videoInputDevices,
|
||||||
{
|
{
|
||||||
|
@ -420,7 +420,7 @@
|
|||||||
<div class=" font-semibold line-clamp-1">{model.name}</div>
|
<div class=" font-semibold line-clamp-1">{model.name}</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<div class=" text-xs overflow-hidden text-ellipsis line-clamp-1 text-gray-500">
|
<div class=" text-xs overflow-hidden text-ellipsis line-clamp-1 text-gray-500">
|
||||||
{!!model?.info?.meta?.description
|
{model?.info?.meta?.description
|
||||||
? model?.info?.meta?.description
|
? model?.info?.meta?.description
|
||||||
: model?.ollama?.digest
|
: model?.ollama?.digest
|
||||||
? `${model.id} (${model?.ollama?.digest})`
|
? `${model.id} (${model?.ollama?.digest})`
|
||||||
|
@ -38,10 +38,10 @@ const createIsLoadingStore = (i18n: i18nType) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const initI18n = (defaultLocale: string | undefined) => {
|
export const initI18n = (defaultLocale: string | undefined) => {
|
||||||
let detectionOrder = defaultLocale
|
const detectionOrder = defaultLocale
|
||||||
? ['querystring', 'localStorage']
|
? ['querystring', 'localStorage']
|
||||||
: ['querystring', 'localStorage', 'navigator'];
|
: ['querystring', 'localStorage', 'navigator'];
|
||||||
let fallbackDefaultLocale = defaultLocale ? [defaultLocale] : ['en-US'];
|
const fallbackDefaultLocale = defaultLocale ? [defaultLocale] : ['en-US'];
|
||||||
|
|
||||||
const loadResource = (language: string, namespace: string) =>
|
const loadResource = (language: string, namespace: string) =>
|
||||||
import(`./locales/${language}/${namespace}.json`);
|
import(`./locales/${language}/${namespace}.json`);
|
||||||
|
@ -74,15 +74,15 @@ const readPngChunks = (data) => {
|
|||||||
|
|
||||||
if (!isValidPng) throw new Error('Invalid PNG file');
|
if (!isValidPng) throw new Error('Invalid PNG file');
|
||||||
|
|
||||||
let chunks = [];
|
const chunks = [];
|
||||||
let offset = 8; // Skip PNG signature
|
let offset = 8; // Skip PNG signature
|
||||||
|
|
||||||
while (offset < data.length) {
|
while (offset < data.length) {
|
||||||
let length =
|
const length =
|
||||||
(data[offset] << 24) | (data[offset + 1] << 16) | (data[offset + 2] << 8) | data[offset + 3];
|
(data[offset] << 24) | (data[offset + 1] << 16) | (data[offset + 2] << 8) | data[offset + 3];
|
||||||
let type = String.fromCharCode.apply(null, data.slice(offset + 4, offset + 8));
|
const type = String.fromCharCode.apply(null, data.slice(offset + 4, offset + 8));
|
||||||
let chunkData = data.slice(offset + 8, offset + 8 + length);
|
const chunkData = data.slice(offset + 8, offset + 8 + length);
|
||||||
let crc =
|
const crc =
|
||||||
(data[offset + 8 + length] << 24) |
|
(data[offset + 8 + length] << 24) |
|
||||||
(data[offset + 8 + length + 1] << 16) |
|
(data[offset + 8 + length + 1] << 16) |
|
||||||
(data[offset + 8 + length + 2] << 8) |
|
(data[offset + 8 + length + 2] << 8) |
|
||||||
|
@ -18,8 +18,8 @@ const DELIMITER_LIST = [
|
|||||||
// const inlineRule = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n\$]))\1(?=[\s?!\.,:?!。,:]|$)/;
|
// const inlineRule = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n\$]))\1(?=[\s?!\.,:?!。,:]|$)/;
|
||||||
// const blockRule = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
|
// const blockRule = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
|
||||||
|
|
||||||
let inlinePatterns = [];
|
const inlinePatterns = [];
|
||||||
let blockPatterns = [];
|
const blockPatterns = [];
|
||||||
|
|
||||||
function escapeRegex(string) {
|
function escapeRegex(string) {
|
||||||
return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
||||||
@ -61,7 +61,7 @@ export default function (options = {}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function katexStart(src, displayMode: boolean) {
|
function katexStart(src, displayMode: boolean) {
|
||||||
let ruleReg = displayMode ? blockRule : inlineRule;
|
const ruleReg = displayMode ? blockRule : inlineRule;
|
||||||
|
|
||||||
let indexSrc = src;
|
let indexSrc = src;
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ function katexStart(src, displayMode: boolean) {
|
|||||||
let startIndex = -1;
|
let startIndex = -1;
|
||||||
let startDelimiter = '';
|
let startDelimiter = '';
|
||||||
let endDelimiter = '';
|
let endDelimiter = '';
|
||||||
for (let delimiter of DELIMITER_LIST) {
|
for (const delimiter of DELIMITER_LIST) {
|
||||||
if (delimiter.display !== displayMode) {
|
if (delimiter.display !== displayMode) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -105,8 +105,8 @@ function katexStart(src, displayMode: boolean) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function katexTokenizer(src, tokens, displayMode: boolean) {
|
function katexTokenizer(src, tokens, displayMode: boolean) {
|
||||||
let ruleReg = displayMode ? blockRule : inlineRule;
|
const ruleReg = displayMode ? blockRule : inlineRule;
|
||||||
let type = displayMode ? 'blockKatex' : 'inlineKatex';
|
const type = displayMode ? 'blockKatex' : 'inlineKatex';
|
||||||
|
|
||||||
const match = src.match(ruleReg);
|
const match = src.match(ruleReg);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user