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
fad00a85
"git@developer.sourcefind.cn:OpenDAS/torchani.git" did not exist on "4bacf402fb0dfe03943330b6fa2f56fc4b90af17"
Commit
fad00a85
authored
Apr 22, 2024
by
Bruce MacDonald
Browse files
stop running model on interactive exit
parent
62be2050
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
cmd/interactive.go
cmd/interactive.go
+8
-0
No files found.
cmd/interactive.go
View file @
fad00a85
...
@@ -475,6 +475,14 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
...
@@ -475,6 +475,14 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
usage
()
usage
()
}
}
case
strings
.
HasPrefix
(
line
,
"/exit"
),
strings
.
HasPrefix
(
line
,
"/bye"
)
:
case
strings
.
HasPrefix
(
line
,
"/exit"
),
strings
.
HasPrefix
(
line
,
"/bye"
)
:
// stop the running model
client
,
err
:=
api
.
ClientFromEnvironment
()
if
err
!=
nil
{
return
err
}
client
.
Chat
(
cmd
.
Context
(),
&
api
.
ChatRequest
{
Model
:
opts
.
Model
,
KeepAlive
:
&
api
.
Duration
{}},
func
(
resp
api
.
ChatResponse
)
error
{
return
nil
})
return
nil
return
nil
case
strings
.
HasPrefix
(
line
,
"/"
)
:
case
strings
.
HasPrefix
(
line
,
"/"
)
:
args
:=
strings
.
Fields
(
line
)
args
:=
strings
.
Fields
(
line
)
...
...
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