From 092bb0bd6b071daeb5d3b57fd0c0cb2853389efb Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sat, 5 Oct 2024 15:14:27 +0200 Subject: [PATCH] fix(base-grpc): close channel in base grpc server (#3734) If the LLM does not implement any logic for PredictStream, we close the channel immediately to not leave the process hanging. Signed-off-by: Ettore Di Giacinto --- pkg/grpc/base/base.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/grpc/base/base.go b/pkg/grpc/base/base.go index 95dca561c9b9..3356f86beaa2 100644 --- a/pkg/grpc/base/base.go +++ b/pkg/grpc/base/base.go @@ -41,6 +41,7 @@ func (llm *Base) Predict(opts *pb.PredictOptions) (string, error) { } func (llm *Base) PredictStream(opts *pb.PredictOptions, results chan string) error { + close(results) return fmt.Errorf("unimplemented") }