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
5121b7ac
You need to sign in or sign up before continuing.
Commit
5121b7ac
authored
Jan 12, 2024
by
Michael Yang
Browse files
remove double newlines in /set parameter
parent
3773fb64
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
cmd/interactive.go
cmd/interactive.go
+6
-6
No files found.
cmd/interactive.go
View file @
5121b7ac
...
@@ -241,10 +241,10 @@ func generateInteractive(cmd *cobra.Command, opts generateOptions) error {
...
@@ -241,10 +241,10 @@ func generateInteractive(cmd *cobra.Command, opts generateOptions) error {
params
:=
args
[
3
:
]
params
:=
args
[
3
:
]
fp
,
err
:=
api
.
FormatParams
(
map
[
string
][]
string
{
args
[
2
]
:
params
})
fp
,
err
:=
api
.
FormatParams
(
map
[
string
][]
string
{
args
[
2
]
:
params
})
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Printf
(
"Couldn't set parameter: %q
\n
\n
"
,
err
)
fmt
.
Printf
(
"Couldn't set parameter: %q
\n
"
,
err
)
continue
continue
}
}
fmt
.
Printf
(
"Set parameter '%s' to '%s'
\n
\n
"
,
args
[
2
],
strings
.
Join
(
params
,
", "
))
fmt
.
Printf
(
"Set parameter '%s' to '%s'
\n
"
,
args
[
2
],
strings
.
Join
(
params
,
", "
))
opts
.
Options
[
args
[
2
]]
=
fp
[
args
[
2
]]
opts
.
Options
[
args
[
2
]]
=
fp
[
args
[
2
]]
case
"system"
,
"template"
:
case
"system"
,
"template"
:
if
len
(
args
)
<
3
{
if
len
(
args
)
<
3
{
...
@@ -325,7 +325,7 @@ func generateInteractive(cmd *cobra.Command, opts generateOptions) error {
...
@@ -325,7 +325,7 @@ func generateInteractive(cmd *cobra.Command, opts generateOptions) error {
fmt
.
Println
(
""
)
fmt
.
Println
(
""
)
case
"license"
:
case
"license"
:
if
resp
.
License
==
""
{
if
resp
.
License
==
""
{
fmt
.
Print
(
"No license was specified for this model.
\n\n
"
)
fmt
.
Print
ln
(
"No license was specified for this model."
)
}
else
{
}
else
{
fmt
.
Println
(
resp
.
License
)
fmt
.
Println
(
resp
.
License
)
}
}
...
@@ -333,7 +333,7 @@ func generateInteractive(cmd *cobra.Command, opts generateOptions) error {
...
@@ -333,7 +333,7 @@ func generateInteractive(cmd *cobra.Command, opts generateOptions) error {
fmt
.
Println
(
resp
.
Modelfile
)
fmt
.
Println
(
resp
.
Modelfile
)
case
"parameters"
:
case
"parameters"
:
if
resp
.
Parameters
==
""
{
if
resp
.
Parameters
==
""
{
fmt
.
Print
(
"No parameters were specified for this model.
\n\n
"
)
fmt
.
Print
ln
(
"No parameters were specified for this model."
)
}
else
{
}
else
{
if
len
(
opts
.
Options
)
>
0
{
if
len
(
opts
.
Options
)
>
0
{
fmt
.
Println
(
"User defined parameters:"
)
fmt
.
Println
(
"User defined parameters:"
)
...
@@ -352,7 +352,7 @@ func generateInteractive(cmd *cobra.Command, opts generateOptions) error {
...
@@ -352,7 +352,7 @@ func generateInteractive(cmd *cobra.Command, opts generateOptions) error {
case
resp
.
System
!=
""
:
case
resp
.
System
!=
""
:
fmt
.
Println
(
resp
.
System
+
"
\n
"
)
fmt
.
Println
(
resp
.
System
+
"
\n
"
)
default
:
default
:
fmt
.
Print
(
"No system message was specified for this model.
\n\n
"
)
fmt
.
Print
ln
(
"No system message was specified for this model."
)
}
}
case
"template"
:
case
"template"
:
switch
{
switch
{
...
@@ -361,7 +361,7 @@ func generateInteractive(cmd *cobra.Command, opts generateOptions) error {
...
@@ -361,7 +361,7 @@ func generateInteractive(cmd *cobra.Command, opts generateOptions) error {
case
resp
.
Template
!=
""
:
case
resp
.
Template
!=
""
:
fmt
.
Println
(
resp
.
Template
)
fmt
.
Println
(
resp
.
Template
)
default
:
default
:
fmt
.
Print
(
"No prompt template was specified for this model.
\n\n
"
)
fmt
.
Print
ln
(
"No prompt template was specified for this model."
)
}
}
default
:
default
:
fmt
.
Printf
(
"Unknown command '/show %s'. Type /? for help
\n
"
,
args
[
1
])
fmt
.
Printf
(
"Unknown command '/show %s'. Type /? for help
\n
"
,
args
[
1
])
...
...
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