fix(lightrag): 修复 lightrag 知识库 embedding dim 的错误 Fixes: Error: 知识库上传PDF检索测试失败
Fixes #498 Error: ValueError: Embedding dimension mismatch detected: total elements (1024) cannot be evenly divided by expected dimension (1536) Fixes #491
This commit is contained in:
parent
0a8606b71f
commit
e0adda65fc
@ -1,5 +1,6 @@
|
||||
import os
|
||||
import traceback
|
||||
from functools import partial
|
||||
|
||||
from lightrag import LightRAG, QueryParam
|
||||
from lightrag.kg.shared_storage import initialize_pipeline_status
|
||||
@ -222,8 +223,9 @@ class LightRagKB(KnowledgeBase):
|
||||
return EmbeddingFunc(
|
||||
embedding_dim=config_dict["dimension"],
|
||||
max_token_size=8192,
|
||||
func=lambda texts: openai_embed(
|
||||
texts=texts,
|
||||
model_name=model_name,
|
||||
func=partial(
|
||||
openai_embed.func,
|
||||
model=model_name,
|
||||
api_key=config_dict["api_key"],
|
||||
base_url=config_dict["base_url"].replace("/embeddings", ""),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user