From b690eaf07fcdf37b2f9b47bbcb1f21a80fedcf34 Mon Sep 17 00:00:00 2001 From: Xiao Date: Tue, 25 Feb 2025 11:25:49 +0100 Subject: [PATCH] replace outdated openAI model --- common/utils/milvus_utils.py | 2 +- dockerfiles/compose/milvus.yaml | 4 ++-- im_client/llms/openai.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/utils/milvus_utils.py b/common/utils/milvus_utils.py index 12e6e52..66b50a8 100644 --- a/common/utils/milvus_utils.py +++ b/common/utils/milvus_utils.py @@ -16,7 +16,7 @@ import asyncio, json from tenacity import retry, stop_after_attempt, wait_exponential -openai_engine = "text-embedding-ada-002" +openai_engine = "text-embedding-3-small" VECTOR_DIMENSION = 1536 client = OpenAI() diff --git a/dockerfiles/compose/milvus.yaml b/dockerfiles/compose/milvus.yaml index dd60ee2..4b4bf15 100644 --- a/dockerfiles/compose/milvus.yaml +++ b/dockerfiles/compose/milvus.yaml @@ -23,8 +23,8 @@ services: container_name: milvus-minio image: minio/minio:RELEASE.2023-03-20T20-16-18Z environment: - MINIO_ACCESS_KEY: minioadmin - MINIO_SECRET_KEY: + MINIO_ROOT_USER: minioadmin + MINIO_ROOT_PASSWORD: minioadmin # ports: # - "9001:9001" diff --git a/im_client/llms/openai.py b/im_client/llms/openai.py index 8585244..574ace5 100644 --- a/im_client/llms/openai.py +++ b/im_client/llms/openai.py @@ -390,11 +390,11 @@ def get_embedding(text: str) -> np.array: try: text = text.replace("\n", " ") if openai.api_type == "azure": - embedding = sync_openai_client.embeddings.create(input=[text], deployment_id="text-embedding-ada-002")[ + embedding = sync_openai_client.embeddings.create(input=[text], deployment_id="text-embedding-3-small")[ "data" ][0]["embedding"] else: - embedding = sync_openai_client.embeddings.create(input=[text], model="text-embedding-ada-002")["data"][0][ + embedding = sync_openai_client.embeddings.create(input=[text], model="text-embedding-3-small")["data"][0][ "embedding" ] return tuple(embedding)