Skip to content
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

fix(wren-ai-service): disable pass embedding model dim to embedders #579

Merged
merged 5 commits into from
Aug 5, 2024

Conversation

cyyeh
Copy link
Member

@cyyeh cyyeh commented Aug 3, 2024

No description provided.

@cyyeh cyyeh added module/ai-service ai-service related ci/ai-service ai-service related labels Aug 3, 2024
@cyyeh cyyeh requested a review from paopa August 3, 2024 11:46
@cyyeh cyyeh force-pushed the fix/ai-service/wo-embedding-model-dim branch from 7d44d89 to 08ddb34 Compare August 5, 2024 03:06
@@ -25,6 +25,7 @@ COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}

COPY src src
COPY entrypoint.sh /app/entrypoint.sh
COPY pyproject.toml pyproject.toml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems been copied in L13, why did we copy it again?

@@ -25,6 +25,7 @@ aiohttp = {extras = ["speedups"], version = "==3.9.5"}
ollama-haystack = "==0.0.6"
langfuse = "==2.35.0"
ollama = "==0.2.1"
toml = "==0.10.2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think that we move the tomlkit from eval group to main?

@@ -220,7 +220,6 @@ def get_text_embedder(self):
return AsyncTextEmbedder(
api_key=self._embedding_api_key,
model=self._embedding_model,
dimensions=self._embedding_model_dim,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What’s the reason for removing the parameter? Also, what do you think about removing the attribute from the object initializer and related code? It seems like it might clutter the Langfuse trace with unnecessary information.

Comment on lines +166 to +175
embedding_model_dim: int = (
int(os.getenv("EMBEDDING_MODEL_DIMENSION"))
if os.getenv("EMBEDDING_MODEL_DIMENSION")
else 0
)
or EMBEDDING_MODEL_DIMENSION,
):
self._url = remove_trailing_slash(url)
self._embedding_model = embedding_model
self._embedding_model_dim = embedding_model_dim
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn’t seem to be used anywhere. I think we can remove it.

Comment on lines -221 to -229
dimensions=self._embedding_model_dim,
)

def get_document_embedder(self):
return AsyncDocumentEmbedder(
api_key=self._api_key,
api_base_url=self._api_base,
model=self._embedding_model,
dimensions=self._embedding_model_dim,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the comment as Azure OpenAI

Copy link
Member

@paopa paopa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have discussed offline. LGTM. thanks for the work!

@paopa paopa merged commit 190c85c into main Aug 5, 2024
8 checks passed
@paopa paopa deleted the fix/ai-service/wo-embedding-model-dim branch August 5, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/ai-service ai-service related module/ai-service ai-service related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants