mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-12 20:18:11 +00:00
fix: use bytes in gRPC proto instead of strings (#813)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
committed by
GitHub
parent
0af0df7423
commit
b96e30e66c
@ -67,9 +67,9 @@ func ModelInference(ctx context.Context, s string, loader *model.ModelLoader, c
|
||||
opts.Prompt = s
|
||||
if tokenCallback != nil {
|
||||
ss := ""
|
||||
err := inferenceModel.PredictStream(ctx, opts, func(s string) {
|
||||
tokenCallback(s)
|
||||
ss += s
|
||||
err := inferenceModel.PredictStream(ctx, opts, func(s []byte) {
|
||||
tokenCallback(string(s))
|
||||
ss += string(s)
|
||||
})
|
||||
return ss, err
|
||||
} else {
|
||||
@ -77,7 +77,7 @@ func ModelInference(ctx context.Context, s string, loader *model.ModelLoader, c
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return reply.Message, err
|
||||
return string(reply.Message), err
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user