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
7eda70f2
Commit
7eda70f2
authored
Aug 17, 2023
by
Michael Yang
Browse files
copy metadata from source
parent
3d79b414
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
server/images.go
server/images.go
+21
-1
No files found.
server/images.go
View file @
7eda70f2
...
@@ -325,7 +325,27 @@ func CreateModel(ctx context.Context, name string, path string, fn func(resp api
...
@@ -325,7 +325,27 @@ func CreateModel(ctx context.Context, name string, path string, fn func(resp api
}
}
if
mf
!=
nil
{
if
mf
!=
nil
{
log
.
Printf
(
"manifest = %#v"
,
mf
)
sourceBlobPath
,
err
:=
GetBlobsPath
(
mf
.
Config
.
Digest
)
if
err
!=
nil
{
return
err
}
sourceBlob
,
err
:=
os
.
Open
(
sourceBlobPath
)
if
err
!=
nil
{
return
err
}
defer
sourceBlob
.
Close
()
var
source
ConfigV2
if
err
:=
json
.
NewDecoder
(
sourceBlob
)
.
Decode
(
&
source
);
err
!=
nil
{
return
err
}
// copie the model metadata
config
.
ModelFamily
=
source
.
ModelFamily
config
.
ModelType
=
source
.
ModelType
config
.
FileType
=
source
.
FileType
for
_
,
l
:=
range
mf
.
Layers
{
for
_
,
l
:=
range
mf
.
Layers
{
newLayer
,
err
:=
GetLayerWithBufferFromLayer
(
l
)
newLayer
,
err
:=
GetLayerWithBufferFromLayer
(
l
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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