mirror of
https://git.boos.lat/aibo/BossChat.git
synced 2026-10-30 07:06:08 +00:00
fix: reduce chunk size to prevent embedding context overflow
nomic-embed-text tokenizes Chinese characters differently from the estimateTokenCount heuristic (3-5 real tokens per character vs 1 estimated). Large chunks overflow the 8192 token context. Reduce TargetTokens/MaxTokens to keep chunks within limits.
This commit is contained in:
@@ -38,9 +38,9 @@ const knowledgeCollectionName = "knowledge_chunks"
|
||||
var Index = &index{
|
||||
chunkConfig: ChunkingConfig{
|
||||
Provider: string(enums.KnowledgeChunkProviderStructured),
|
||||
TargetTokens: 300,
|
||||
MaxTokens: 400,
|
||||
OverlapTokens: 40,
|
||||
TargetTokens: 100,
|
||||
MaxTokens: 150,
|
||||
OverlapTokens: 20,
|
||||
EnableFallback: true,
|
||||
},
|
||||
registry: ragchunk.NewDefaultRegistry(),
|
||||
|
||||
Reference in New Issue
Block a user