fix: max chunk size

This commit is contained in:
kangfenmao 2025-02-09 09:32:40 +08:00
parent 555a991a30
commit 0a3ad04f12
2 changed files with 113 additions and 113 deletions

View File

@ -1,227 +1,227 @@
export const EMBEDDING_MODELS = [ export const EMBEDDING_MODELS = [
{ {
"id": "Doubao-embedding", id: 'Doubao-embedding',
"max_context": 4095 max_context: 4095
}, },
{ {
"id": "Doubao-embedding-vision", id: 'Doubao-embedding-vision',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "Doubao-embedding-large", id: 'Doubao-embedding-large',
"max_context": 4095 max_context: 4095
}, },
{ {
"id": "text-embedding-v3", id: 'text-embedding-v3',
"max_context": 8192 max_context: 8192
}, },
{ {
"id": "text-embedding-v2", id: 'text-embedding-v2',
"max_context": 2048 max_context: 2048
}, },
{ {
"id": "text-embedding-v1", id: 'text-embedding-v1',
"max_context": 2048 max_context: 2048
}, },
{ {
"id": "text-embedding-async-v2", id: 'text-embedding-async-v2',
"max_context": 2048 max_context: 2048
}, },
{ {
"id": "text-embedding-async-v1", id: 'text-embedding-async-v1',
"max_context": 2048 max_context: 2048
}, },
{ {
"id": "text-embedding-3-small", id: 'text-embedding-3-small',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "text-embedding-3-large", id: 'text-embedding-3-large',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "text-embedding-ada-002", id: 'text-embedding-ada-002',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "Embedding-V1", id: 'Embedding-V1',
"max_context": 384 max_context: 384
}, },
{ {
"id": "tao-8k", id: 'tao-8k',
"max_context": 8192 max_context: 8192
}, },
{ {
"id": "embedding-2", id: 'embedding-2',
"max_context": 1024 max_context: 1024
}, },
{ {
"id": "embedding-3", id: 'embedding-3',
"max_context": 2048 max_context: 2048
}, },
{ {
"id": "hunyuan-embedding", id: 'hunyuan-embedding',
"max_context": 1024 max_context: 1024
}, },
{ {
"id": "Baichuan-Text-Embedding", id: 'Baichuan-Text-Embedding',
"max_context": 512 max_context: 512
}, },
{ {
"id": "M2-BERT-80M-2K-Retrieval", id: 'M2-BERT-80M-2K-Retrieval',
"max_context": 2048 max_context: 2048
}, },
{ {
"id": "M2-BERT-80M-8K-Retrieval", id: 'M2-BERT-80M-8K-Retrieval',
"max_context": 8192 max_context: 8192
}, },
{ {
"id": "M2-BERT-80M-32K-Retrieval", id: 'M2-BERT-80M-32K-Retrieval',
"max_context": 32768 max_context: 32768
}, },
{ {
"id": "UAE-Large-v1", id: 'UAE-Large-v1',
"max_context": 512 max_context: 512
}, },
{ {
"id": "BGE-Large-EN-v1.5", id: 'BGE-Large-EN-v1.5',
"max_context": 512 max_context: 512
}, },
{ {
"id": "BGE-Base-EN-v1.5", id: 'BGE-Base-EN-v1.5',
"max_context": 512 max_context: 512
}, },
{ {
"id": "jina-embedding-b-en-v1", id: 'jina-embedding-b-en-v1',
"max_context": 512 max_context: 512
}, },
{ {
"id": "jina-embeddings-v2-base-en", id: 'jina-embeddings-v2-base-en',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "jina-embeddings-v2-base-zh", id: 'jina-embeddings-v2-base-zh',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "jina-embeddings-v2-base-de", id: 'jina-embeddings-v2-base-de',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "jina-embeddings-v2-base-code", id: 'jina-embeddings-v2-base-code',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "jina-embeddings-v2-base-es", id: 'jina-embeddings-v2-base-es',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "jina-colbert-v1-en", id: 'jina-colbert-v1-en',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "jina-reranker-v1-base-en", id: 'jina-reranker-v1-base-en',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "jina-reranker-v1-turbo-en", id: 'jina-reranker-v1-turbo-en',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "jina-reranker-v1-tiny-en", id: 'jina-reranker-v1-tiny-en',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "jina-clip-v1", id: 'jina-clip-v1',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "jina-reranker-v2-base-multilingual", id: 'jina-reranker-v2-base-multilingual',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "reader-lm-1.5b", id: 'reader-lm-1.5b',
"max_context": 256000 max_context: 256000
}, },
{ {
"id": "reader-lm-0.5b", id: 'reader-lm-0.5b',
"max_context": 256000 max_context: 256000
}, },
{ {
"id": "jina-colbert-v2", id: 'jina-colbert-v2',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "jina-embeddings-v3", id: 'jina-embeddings-v3',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "BAAI/bge-m3", id: 'BAAI/bge-m3',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "netease-youdao/bce-embedding-base_v1", id: 'netease-youdao/bce-embedding-base_v1',
"max_context": 512 max_context: 512
}, },
{ {
"id": "BAAI/bge-large-zh-v1.5", id: 'BAAI/bge-large-zh-v1.5',
"max_context": 512 max_context: 512
}, },
{ {
"id": "BAAI/bge-large-en-v1.5", id: 'BAAI/bge-large-en-v1.5',
"max_context": 512 max_context: 512
}, },
{ {
"id": "Pro/BAAI/bge-m3", id: 'Pro/BAAI/bge-m3',
"max_context": 8191 max_context: 8191
}, },
{ {
"id": "nomic-embed-text-v1", id: 'nomic-embed-text-v1',
"max_context": 8192 max_context: 8192
}, },
{ {
"id": "nomic-embed-text-v1.5", id: 'nomic-embed-text-v1.5',
"max_context": 8192 max_context: 8192
}, },
{ {
"id": "gte-multilingual-base", id: 'gte-multilingual-base',
"max_context": 8192 max_context: 8192
}, },
{ {
"id": "embedding-query", id: 'embedding-query',
"max_context": 4000 max_context: 4000
}, },
{ {
"id": "embedding-passage", id: 'embedding-passage',
"max_context": 4000 max_context: 4000
}, },
{ {
"id": "embed-english-v3.0", id: 'embed-english-v3.0',
"max_context": 512 max_context: 512
}, },
{ {
"id": "embed-english-light-v3.0", id: 'embed-english-light-v3.0',
"max_context": 512 max_context: 512
}, },
{ {
"id": "embed-multilingual-v3.0", id: 'embed-multilingual-v3.0',
"max_context": 512 max_context: 512
}, },
{ {
"id": "embed-multilingual-light-v3.0", id: 'embed-multilingual-light-v3.0',
"max_context": 512 max_context: 512
}, },
{ {
"id": "embed-english-v2.0", id: 'embed-english-v2.0',
"max_context": 512 max_context: 512
}, },
{ {
"id": "embed-english-light-v2.0", id: 'embed-english-light-v2.0',
"max_context": 512 max_context: 512
}, },
{ {
"id": "embed-multilingual-v2.0", id: 'embed-multilingual-v2.0',
"max_context": 256 max_context: 256
} }
] ]

View File

@ -25,7 +25,7 @@ export const getKnowledgeBaseParams = (base: KnowledgeBase): KnowledgeBaseParams
if (chunkSize && chunkSize > maxChunkSize) { if (chunkSize && chunkSize > maxChunkSize) {
chunkSize = maxChunkSize chunkSize = maxChunkSize
} }
if (!chunkSize) { if (!chunkSize && maxChunkSize < 1024) {
chunkSize = maxChunkSize chunkSize = maxChunkSize
} }
} }