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
053739d1
Commit
053739d1
authored
Jul 07, 2023
by
Michael Yang
Browse files
no prompt on empty line
parent
3d73ad0c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
26 deletions
+31
-26
cmd/cmd.go
cmd/cmd.go
+30
-26
server/templates/wizardlm.prompt
server/templates/wizardlm.prompt
+1
-0
No files found.
cmd/cmd.go
View file @
053739d1
...
@@ -9,6 +9,7 @@ import (
...
@@ -9,6 +9,7 @@ import (
"net"
"net"
"os"
"os"
"path"
"path"
"strings"
"time"
"time"
"github.com/schollz/progressbar/v3"
"github.com/schollz/progressbar/v3"
...
@@ -79,6 +80,7 @@ func RunGenerate(_ *cobra.Command, args []string) error {
...
@@ -79,6 +80,7 @@ func RunGenerate(_ *cobra.Command, args []string) error {
}
}
func
generate
(
model
,
prompt
string
)
error
{
func
generate
(
model
,
prompt
string
)
error
{
if
len
(
strings
.
TrimSpace
(
prompt
))
>
0
{
client
:=
api
.
NewClient
()
client
:=
api
.
NewClient
()
spinner
:=
progressbar
.
NewOptions
(
-
1
,
spinner
:=
progressbar
.
NewOptions
(
-
1
,
...
@@ -111,6 +113,8 @@ func generate(model, prompt string) error {
...
@@ -111,6 +113,8 @@ func generate(model, prompt string) error {
fmt
.
Println
()
fmt
.
Println
()
fmt
.
Println
()
fmt
.
Println
()
}
return
nil
return
nil
}
}
...
...
server/templates/wizardlm.prompt
View file @
053739d1
{{ .Prompt }}
{{ .Prompt }}
### Response:
### Response:
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