mirror of
https://github.com/tcsenpai/ollama.git
synced 2025-06-08 04:05:20 +00:00
no prompt on empty line
This commit is contained in:
parent
3d73ad0c56
commit
053739d19f
@ -9,6 +9,7 @@ import (
|
||||
"net"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/schollz/progressbar/v3"
|
||||
@ -79,6 +80,7 @@ func RunGenerate(_ *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
func generate(model, prompt string) error {
|
||||
if len(strings.TrimSpace(prompt)) > 0 {
|
||||
client := api.NewClient()
|
||||
|
||||
spinner := progressbar.NewOptions(-1,
|
||||
@ -111,6 +113,8 @@ func generate(model, prompt string) error {
|
||||
|
||||
fmt.Println()
|
||||
fmt.Println()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -1,2 +1,3 @@
|
||||
{{ .Prompt }}
|
||||
|
||||
### Response:
|
||||
|
Loading…
x
Reference in New Issue
Block a user