"git@developer.sourcefind.cn:OpenDAS/apex.git" did not exist on "843cdbe01a63fe2e0eca35e4d910130b1b8a5aad"
Commit 2bc06565 authored by Michael Yang's avatar Michael Yang
Browse files

fix empty response

parent d1c2558f
...@@ -497,8 +497,10 @@ func (llm *llama) Predict(ctx context.Context, prevContext []int, prompt string, ...@@ -497,8 +497,10 @@ func (llm *llama) Predict(ctx context.Context, prevContext []int, prompt string,
return fmt.Errorf("error unmarshaling llm prediction response: %v", err) return fmt.Errorf("error unmarshaling llm prediction response: %v", err)
} }
fn(api.GenerateResponse{Response: p.Content}) if p.Content != "" {
nextContext.WriteString(p.Content) fn(api.GenerateResponse{Response: p.Content})
nextContext.WriteString(p.Content)
}
if p.Stop { if p.Stop {
embd, err := llm.Encode(ctx, nextContext.String()) embd, err := llm.Encode(ctx, nextContext.String())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment