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
ac0801ec
"docs/vscode:/vscode.git/clone" did not exist on "048a2d404c6a909e6f835ba18182fbfae130ba09"
Commit
ac0801ec
authored
Apr 24, 2024
by
Michael Yang
Browse files
only replace if it matches command
parent
ad66e5b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
cmd/cmd.go
cmd/cmd.go
+8
-1
No files found.
cmd/cmd.go
View file @
ac0801ec
...
...
@@ -17,6 +17,7 @@ import (
"os"
"os/signal"
"path/filepath"
"regexp"
"runtime"
"strings"
"syscall"
...
...
@@ -110,7 +111,13 @@ func CreateHandler(cmd *cobra.Command, args []string) error {
return
err
}
modelfile
=
bytes
.
ReplaceAll
(
modelfile
,
[]
byte
(
c
.
Args
),
[]
byte
(
"@"
+
digest
))
name
:=
c
.
Name
if
c
.
Name
==
"model"
{
name
=
"from"
}
re
:=
regexp
.
MustCompile
(
fmt
.
Sprintf
(
`(?im)^(%s)\s+%s\s*$`
,
name
,
c
.
Args
))
modelfile
=
re
.
ReplaceAll
(
modelfile
,
[]
byte
(
"$1 @"
+
digest
))
}
}
...
...
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