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
6225fde0
Unverified
Commit
6225fde0
authored
Jan 22, 2024
by
Michael Yang
Committed by
GitHub
Jan 22, 2024
Browse files
Merge pull request #2102 from jmorganca/mxyng/fix-create-override
fix: remove overwritten model layers
parents
06918456
c08dfaa2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
server/images.go
server/images.go
+7
-2
No files found.
server/images.go
View file @
6225fde0
...
...
@@ -412,6 +412,13 @@ func realpath(mfDir, from string) string {
}
func
CreateModel
(
ctx
context
.
Context
,
name
,
modelFileDir
string
,
commands
[]
parser
.
Command
,
fn
func
(
resp
api
.
ProgressResponse
))
error
{
deleteMap
:=
make
(
map
[
string
]
struct
{})
if
manifest
,
_
,
err
:=
GetManifest
(
ParseModelPath
(
name
));
err
==
nil
{
for
_
,
layer
:=
range
append
(
manifest
.
Layers
,
manifest
.
Config
)
{
deleteMap
[
layer
.
Digest
]
=
struct
{}{}
}
}
config
:=
ConfigV2
{
OS
:
"linux"
,
Architecture
:
"amd64"
,
...
...
@@ -420,8 +427,6 @@ func CreateModel(ctx context.Context, name, modelFileDir string, commands []pars
},
}
deleteMap
:=
make
(
map
[
string
]
struct
{})
var
layers
Layers
params
:=
make
(
map
[
string
][]
string
)
...
...
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