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

Vector for Target Multidimensional Target Vectors #1527

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

nathanwilk7
Copy link

@nathanwilk7 nathanwilk7 commented Jan 29, 2025

I was debugging the script below from @rlmanrique using this commit bd7db7cb34bf94ece9b1c5f9a56e31afc06e6f0e on Weaviate main and believe that we should still set the target vectors for "multidimensional vectors" in the same way we do for other vectors. I'm not familiar with the Python client code so please correct me if I'm mistaken.

Also, left a code clarification question as a PR comment.

I hit an issue I haven't had time to fix when trying to run tests locally, so I have not run the test suite locally, curious to see the test results are here.

import weaviate
import weaviate.classes.config as wvc


if __name__ == "__main__":

    client = weaviate.connect_to_local()

    # Delete collection
    client.collections.delete("CollectionMultivector")

    vector_index_config = wvc.Configure.VectorIndex.hnsw(
        ef=512,
        multi_vector=wvc.Configure.VectorIndex.MultiVector.multi_vector(),
    )
    vectorizers = [
        wvc.Configure.NamedVectors.none(
            name="colbert",
            vector_index_config=vector_index_config,
        ),
        wvc.Configure.NamedVectors.none(
            name="regular",
            vector_index_config=vector_index_config,
        )
    ]

    collection = client.collections.create(
        name="CollectionMultivector",
        vectorizer_config=vectorizers,
        replication_config=wvc.Configure.replication(factor=1),
    )

    vector = {
        "colbert": weaviate.classes.query.NearVector.multidimensional([[1, 2], [3, 4]])
    }
    response = collection.query.near_vector(
        near_vector=vector, limit=10, target_vector="colbert"
    )

    client.close()

Error from server:

E           	details = "extract target vectors: class CollectionRF1 has multiple vectors, but no target vectors were provided"

@nathanwilk7 nathanwilk7 requested a review from tsmith023 January 29, 2025 09:53
Copy link

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca

@weaviate-git-bot
Copy link

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Slack channel?

@tsmith023 tsmith023 merged commit e414c99 into dev/1.29 Jan 29, 2025
42 checks passed
@tsmith023 tsmith023 deleted the vector-for-target-multidimensional-target-vectors branch January 29, 2025 16:43
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 this pull request may close these issues.

3 participants