记录二次更改

This commit is contained in:
YILING0013
2025-02-02 12:59:13 +08:00
parent bcd13b8ca3
commit f2dc98744d
5 changed files with 401 additions and 107 deletions
+7 -1
View File
@@ -10,7 +10,13 @@ class OllamaEmbeddings:
def __init__(self, model_name: str, base_url: str):
self.model_name = model_name
self.base_url = base_url
def embed(self, texts: List[str]) -> List[List[float]]:
embeddings = []
for text in texts:
embeddings.append(self.embed_single_document(text))
return embeddings
def embed_documents(self, texts: List[str]) -> List[List[float]]:
"""
将多段文本转换为向量列表