fix temporary newline created and removed with spinner in ollama run

This commit is contained in:
Jeffrey Morgan
2023-11-20 00:49:08 -05:00
parent e6ad4813d3
commit 6bbd6e26fb
2 changed files with 15 additions and 6 deletions

View File

@@ -457,7 +457,7 @@ func generate(cmd *cobra.Command, model, prompt string, wordWrap bool, format st
}
p := progress.NewProgress(os.Stderr)
defer p.Stop()
defer p.StopAndClear()
spinner := progress.NewSpinner("")
p.Add("", spinner)
@@ -492,7 +492,6 @@ func generate(cmd *cobra.Command, model, prompt string, wordWrap bool, format st
request := api.GenerateRequest{Model: model, Prompt: prompt, Context: generateContext, Format: format}
fn := func(response api.GenerateResponse) error {
spinner.Stop()
p.StopAndClear()
latest = response