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

Fixes incorrect destructuring #1025

Merged
merged 2 commits into from
Jan 5, 2024
Merged

Fixes incorrect destructuring #1025

merged 2 commits into from
Jan 5, 2024

Conversation

hynky1999
Copy link
Contributor

I have been playing with your library and I was unable to use any concepts because of following errors:

  File "/Users/hynekkdylicek/.pyenv/versions/dev/lib/python3.11/site-packages/lilac/concepts/concept.py", line 365, in _compute_embeddings
    for id, (embedding,) in zip(missing_ids, missing_embeddings):
            ^^^^^^^^^^^
ValueError: too many values to unpack (expected 1)

The problem is that the missing_embeddings can contain multiple embeddings (which I assume happens at long documents):

[{'vector': array([ 6.82974933e-...e=float32), 'span': (...)}, {'vector': array([ 4.36740592e-...e=float32), 'span': (...)}]

This PR fixes this by correctly desctructuring the touple

Copy link
Collaborator

@dsmilkov dsmilkov left a comment

Choose a reason for hiding this comment

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

Awesome catch, thank you!

@dsmilkov dsmilkov enabled auto-merge (squash) January 5, 2024 13:00
@dsmilkov dsmilkov merged commit 8921939 into databricks:main Jan 5, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants