Skip to content

Commit

Permalink
fix 修改maxtoken
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzeyu91 committed Mar 1, 2024
1 parent a3f87bf commit b25e429
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions AntSK/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void InitSK(WebApplicationBuilder builder)
//Kernel Memory
var searchClientConfig = new SearchClientConfig
{
MaxAskPromptSize = 8000,
MaxAskPromptSize = 2048,
MaxMatchesCount = 3,
AnswerTokens = 1000,
EmptyAnswer = "知识库未搜索到相关内容"
Expand All @@ -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,
Expand Down

0 comments on commit b25e429

Please sign in to comment.