From 696daea7750bfc21b38f461da6f53ade3054612c Mon Sep 17 00:00:00 2001 From: zhouchengrong Date: Fri, 8 Nov 2024 14:35:23 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=20=20=20design=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E8=BF=81=E7=A7=BB4090=E6=B5=8B=E8=AF=95=20fi?= =?UTF-8?q?x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/core/config.py | 3 ++- app/service/search_image_with_text/service.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/core/config.py b/app/core/config.py index 5909a3a..37592c3 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -135,7 +135,8 @@ SEGMENTATION = { "input": "seg_input__0", "output": "seg_output__0", } - +# ollama config +OLLAMA_URL = "http://10.1.1.243:11434/api/embeddings" # DESIGN config DESIGN_MODEL_URL = '10.1.1.243:10000' AIDA_CLOTHING = "aida-clothing" diff --git a/app/service/search_image_with_text/service.py b/app/service/search_image_with_text/service.py index 35c5955..edd4d93 100644 --- a/app/service/search_image_with_text/service.py +++ b/app/service/search_image_with_text/service.py @@ -6,6 +6,8 @@ from chromadb.config import Settings from chromadb.utils.embedding_functions.ollama_embedding_function import OllamaEmbeddingFunction from tqdm import tqdm +from app.core.config import OLLAMA_URL + # 读取 csv 文件 # csv_file_path = r'D:/Files/csv/output/output.csv' # image_path = r'D:/images-clean' @@ -18,7 +20,7 @@ client = chromadb.Client(Settings(is_persistent=True, persist_directory="/vector # client = chromadb.Client(Settings(is_persistent=True, persist_directory="D:/workspace/AiDLab/vector_db")) # 创建集合 # embedding_fn = OllamaEmbeddingFunction(url="http://localhost:11434/api/embeddings", model_name="mxbai-embed-large") -embedding_fn = OllamaEmbeddingFunction(url="http://10.1.1.243:11434/api/embeddings", model_name="mxbai-embed-large") +embedding_fn = OllamaEmbeddingFunction(url=OLLAMA_URL, model_name="mxbai-embed-large") # def create_collection():