This commit is contained in:
LarFii
2024-10-15 21:21:57 +08:00
parent cc4af0d75f
commit e34922d292
4 changed files with 7 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
from .lightrag import LightRAG, QueryParam
__version__ = "0.0.4"
__version__ = "0.0.5"
__author__ = "Zirui Guo"
__url__ = "https://github.com/HKUDS/LightRAG"

View File

@@ -141,11 +141,6 @@ async def openai_embedding(texts: list[str]) -> np.ndarray:
return np.array([dp.embedding for dp in response.data])
@wrap_embedding_func_with_attrs(
embedding_dim=384,
max_token_size=5000,
)
async def hf_embedding(texts: list[str], tokenizer, embed_model) -> np.ndarray:
input_ids = tokenizer(texts, return_tensors='pt', padding=True, truncation=True).input_ids
with torch.no_grad():