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

dtype param expected in BaseVectorizer class but missing from EmbeddingsVectorizer #48

Open
banziyeoh opened this issue Jan 22, 2025 · 3 comments · May be fixed by redis/redis-vl-python#261

Comments

@banziyeoh
Copy link

pydantic.v1.error_wrappers.ValidationError: 1 validation error for EmbeddingsVectorizer
dtype
field required (type=value_error.missing)

Problem solved by adding dtype to init method in EmbeddingVectorizer class

    def __init__(self, embeddings: Embeddings):
        dims = len(embeddings.embed_query("test"))
        super().__init__(model="custom_embeddings", dims=dims, embeddings=embeddings, dtype="float32")
@rbs333
Copy link
Collaborator

rbs333 commented Jan 22, 2025

@banziyeoh thanks for providing a fix!

Could you provide a sample of the code you're attempting to invoke that shows the issue? And could you confirm your redisvl version?

@banziyeoh
Copy link
Author

I was using Redis cache with AzureOpenAIEmbeddings

embeddings = AzureOpenAIEmbeddings(
    model=app_settings.azure.embedding_model,
    api_key=app_settings.azure.embedding_api_key,
    api_version=app_settings.azure.embedding_version,
    azure_endpoint=app_settings.azure.embedding_base)
semantic_cache = RedisSemanticCache(embeddings=embeddings,
                                    redis_url="redis://localhost:6379",
                                    ttl=3600,
                                    distance_threshold=0.1)

My redisvl version is 0.3.8

@abrookins
Copy link
Collaborator

@banziyeoh We identified the problem upstream in redisvl and will include it in our next release. Thanks again for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants