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
OpenDAS
ollama
Commits
a19d4764
Commit
a19d4764
authored
Oct 18, 2023
by
Michael Yang
Browse files
models: rm workDir from CreateModel
unused after removing EMBED
parent
a7dad24d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
server/images.go
server/images.go
+1
-1
server/routes.go
server/routes.go
+1
-3
No files found.
server/images.go
View file @
a19d4764
...
@@ -252,7 +252,7 @@ func filenameWithPath(path, f string) (string, error) {
...
@@ -252,7 +252,7 @@ func filenameWithPath(path, f string) (string, error) {
return
f
,
nil
return
f
,
nil
}
}
func
CreateModel
(
ctx
context
.
Context
,
workDir
,
name
string
,
path
string
,
fn
func
(
resp
api
.
ProgressResponse
))
error
{
func
CreateModel
(
ctx
context
.
Context
,
name
string
,
path
string
,
fn
func
(
resp
api
.
ProgressResponse
))
error
{
mp
:=
ParseModelPath
(
name
)
mp
:=
ParseModelPath
(
name
)
var
manifest
*
ManifestV2
var
manifest
*
ManifestV2
...
...
server/routes.go
View file @
a19d4764
...
@@ -334,8 +334,6 @@ func CreateModelHandler(c *gin.Context) {
...
@@ -334,8 +334,6 @@ func CreateModelHandler(c *gin.Context) {
return
return
}
}
workDir
:=
c
.
GetString
(
"workDir"
)
ch
:=
make
(
chan
any
)
ch
:=
make
(
chan
any
)
go
func
()
{
go
func
()
{
defer
close
(
ch
)
defer
close
(
ch
)
...
@@ -346,7 +344,7 @@ func CreateModelHandler(c *gin.Context) {
...
@@ -346,7 +344,7 @@ func CreateModelHandler(c *gin.Context) {
ctx
,
cancel
:=
context
.
WithCancel
(
c
.
Request
.
Context
())
ctx
,
cancel
:=
context
.
WithCancel
(
c
.
Request
.
Context
())
defer
cancel
()
defer
cancel
()
if
err
:=
CreateModel
(
ctx
,
workDir
,
req
.
Name
,
req
.
Path
,
fn
);
err
!=
nil
{
if
err
:=
CreateModel
(
ctx
,
req
.
Name
,
req
.
Path
,
fn
);
err
!=
nil
{
ch
<-
gin
.
H
{
"error"
:
err
.
Error
()}
ch
<-
gin
.
H
{
"error"
:
err
.
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