diff --git a/pkg/grpc/server.go b/pkg/grpc/server.go index 0e602a42..a387b96e 100644 --- a/pkg/grpc/server.go +++ b/pkg/grpc/server.go @@ -144,6 +144,8 @@ func (s *server) PredictStream(in *pb.PredictOptions, stream pb.Backend_PredictS }() err := s.llm.PredictStream(in, resultChan) + // close the channel, so if resultChan is not closed by the LLM (maybe because does not implement PredictStream), the client will not hang + close(resultChan) <-done return err