mirror of
https://github.com/open-webui/open-webui
synced 2025-03-04 11:29:59 +00:00
refac
This commit is contained in:
parent
419005a578
commit
8380d3f5ae
@ -360,12 +360,7 @@ export const generateChatCompletion = async (token: string = '', body: object) =
|
|||||||
return [res, controller];
|
return [res, controller];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createModel = async (
|
export const createModel = async (token: string, payload: object, urlIdx: string | null = null) => {
|
||||||
token: string,
|
|
||||||
tagName: string,
|
|
||||||
content: string,
|
|
||||||
urlIdx: string | null = null
|
|
||||||
) => {
|
|
||||||
let error = null;
|
let error = null;
|
||||||
|
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
@ -377,10 +372,7 @@ export const createModel = async (
|
|||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Authorization: `Bearer ${token}`
|
Authorization: `Bearer ${token}`
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify(payload)
|
||||||
name: tagName,
|
|
||||||
modelfile: content
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
).catch((err) => {
|
).catch((err) => {
|
||||||
error = err;
|
error = err;
|
||||||
|
Loading…
Reference in New Issue
Block a user