From b25e429687953e71c7fb4151bd7e477878967456 Mon Sep 17 00:00:00 2001 From: zyxucp <286513187@qq.com> Date: Fri, 1 Mar 2024 12:15:21 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E6=94=B9maxtoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AntSK/Program.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/AntSK/Program.cs b/AntSK/Program.cs index 364f2610..2d8bb649 100644 --- a/AntSK/Program.cs +++ b/AntSK/Program.cs @@ -144,7 +144,7 @@ void InitSK(WebApplicationBuilder builder) //Kernel Memory var searchClientConfig = new SearchClientConfig { - MaxAskPromptSize = 8000, + MaxAskPromptSize = 2048, MaxMatchesCount = 3, AnswerTokens = 1000, EmptyAnswer = "知识库未搜索到相关内容" @@ -158,12 +158,12 @@ void InitSK(WebApplicationBuilder builder) .WithSimpleFileStorage(new SimpleFileStorageConfig { StorageType = FileSystemTypes.Volatile, Directory = "_files" }) .WithSearchClientConfig(searchClientConfig) //如果用本地模型需要设置token小一点。 - //.WithCustomTextPartitioningOptions(new Microsoft.KernelMemory.Configuration.TextPartitioningOptions - //{ - // MaxTokensPerLine=99, - // MaxTokensPerParagraph=299, - // OverlappingTokens=47 - //}) + .WithCustomTextPartitioningOptions(new Microsoft.KernelMemory.Configuration.TextPartitioningOptions + { + MaxTokensPerLine = 99, + MaxTokensPerParagraph = 299, + OverlappingTokens = 47 + }) .WithOpenAITextGeneration(new OpenAIConfig() { APIKey = OpenAIOption.Key,