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

Add ColPali with double-head architecture #22

Conversation

tonywu71
Copy link
Collaborator

Objective

Create a variant of ColPali that can output both dense and multi-vector embeddings.

@tonywu71 tonywu71 self-assigned this Aug 21, 2024
@tonywu71 tonywu71 marked this pull request as draft August 21, 2024 08:34
colpali_engine/models/colpali_2/colpali_2_architecture.py Outdated Show resolved Hide resolved
colpali_engine/models/colpali_2/colpali_2_loss.py Outdated Show resolved Hide resolved
loss_rowwise = self.matryoshka_loss(scores, torch.arange(scores.shape[0], device=scores.device))
return loss_rowwise

def multi_vector_loss(self, query_embeddings, doc_embeddings) -> torch.Tensor:
Copy link
Collaborator

Choose a reason for hiding this comment

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

this will eventually have to be rebased for the mined negatives to work

colpali_engine/models/colpali_2/colpali_2_loss.py Outdated Show resolved Hide resolved
@tonywu71 tonywu71 force-pushed the add-colpali-with-double-head-architecture branch from 82f1083 to e0786f3 Compare September 1, 2024 15:51
@tonywu71 tonywu71 force-pushed the add-colpali-with-double-head-architecture branch from 9453e04 to dc28fe0 Compare September 9, 2024 14:30
@tonywu71 tonywu71 force-pushed the add-colpali-with-double-head-architecture branch from dc28fe0 to f31b4a2 Compare September 10, 2024 14:19
@tonywu71 tonywu71 changed the base branch from main to fix-restructured-package September 10, 2024 15:15
@tonywu71
Copy link
Collaborator Author

Closing this PR as it was started on a work-in-progress branch that got squashed and merged in #28.

New PR for ColPali2: #48

@tonywu71 tonywu71 closed this Sep 10, 2024
@tonywu71 tonywu71 deleted the add-colpali-with-double-head-architecture branch September 11, 2024 11:47
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.

2 participants