From 0692bb3a0182e0ff90f2164995fc3cb5e985c74c Mon Sep 17 00:00:00 2001 From: bjwswang Date: Fri, 8 Mar 2024 07:37:33 +0000 Subject: [PATCH] fix: set MaxNumberOfConcurrent to 1 if not provided Signed-off-by: bjwswang --- config/samples/app_llmchain_abstract.yaml | 1 + pkg/appruntime/chain/mpchain.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/samples/app_llmchain_abstract.yaml b/config/samples/app_llmchain_abstract.yaml index 572841305..089a2c9a4 100644 --- a/config/samples/app_llmchain_abstract.yaml +++ b/config/samples/app_llmchain_abstract.yaml @@ -91,6 +91,7 @@ metadata: spec: displayName: "llm chain" description: "llm chain" + maxNumberOfConccurent: 1 maxTokens: 20480 maxLength: 20480 model: "6ac7baa2-71e7-4ffc-bd49-9356e743ecbb" diff --git a/pkg/appruntime/chain/mpchain.go b/pkg/appruntime/chain/mpchain.go index ec9262d3f..7f30fff5c 100644 --- a/pkg/appruntime/chain/mpchain.go +++ b/pkg/appruntime/chain/mpchain.go @@ -102,7 +102,7 @@ func (l *MapReduceChain) Run(ctx context.Context, _ client.Client, args map[stri v2, ok := args["max_number_of_conccurent"] if ok { maxNumberOfConcurrent, ok := v2.(int) - if ok { + if ok && maxNumberOfConcurrent > 0 { l.MapReduceDocuments.MaxNumberOfConcurrent = maxNumberOfConcurrent } }