Skip to content

replace outdated openAI model #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/utils/milvus_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/compose/milvus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions im_client/llms/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down