Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
fd42422d
"src/lib/vscode:/vscode.git/clone" did not exist on "14eb667fc8b332d1d8027aee510a4d2a40edb93a"
Commit
fd42422d
authored
Jan 06, 2024
by
Anuraag Jain
Browse files
refac: pullModel api
parent
17a6ca50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
src/lib/apis/ollama/index.ts
src/lib/apis/ollama/index.ts
+5
-11
No files found.
src/lib/apis/ollama/index.ts
View file @
fd42422d
...
...
@@ -249,8 +249,7 @@ export const deleteModel = async (token: string, tagName: string) => {
};
export
const
pullModel
=
async
(
token
:
string
,
tagName
:
string
)
=>
{
let
error
=
null
;
try
{
const
res
=
await
fetch
(
`
${
OLLAMA_API_BASE_URL
}
/pull`
,
{
method
:
'
POST
'
,
headers
:
{
...
...
@@ -260,14 +259,9 @@ export const pullModel = async (token: string, tagName: string) => {
body
:
JSON
.
stringify
({
name
:
tagName
})
}).
catch
((
err
)
=>
{
error
=
err
;
return
null
;
});
if
(
error
)
{
throw
error
;
}
})
return
res
;
}
catch
(
error
)
{
throw
error
;
}
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment