-
Notifications
You must be signed in to change notification settings - Fork 310
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
[v2] add similarity_fn in ModelMeta #1759
[v2] add similarity_fn in ModelMeta #1759
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I really appreciate your suggestions, but I’m not sure if we should rely on the ModelMeta
object for anything during evaluation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added 2 comments as I see that this is meant to be partially complete at this time.
Co-authored-by: Isaac Chung <[email protected]>
6d04547
to
e4a692f
Compare
I made some additional changes, so the PR ended up being a bit larger than originally planned. Please take a look at what I’ve done and share your feedback—I’m looking forward to hearing your thoughts! @Samoed @isaac-chung Just a heads-up, there’s one failing test: #1777. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This currently doesn’t fix the issues with the similarity function, as it focuses only on the retrieval model wrapper. I think the changes should be made in get_model
. The model name and revision can be used there, and the type of similarity function can be passed to the loader.
Lines 156 to 157 in c3b46b7
meta = get_model_meta(model_name, revision) | |
model = meta.load_model(**kwargs) |
Also ModelMeta
can be changed to separate loader
and additional loader_kwargs
Yes, you're correct about the changes. Did you notice these changes? I’m using the st similarity function names and map them to the Enum. |
No, I missed, thanks! But still I think this should be changed to not duplicate |
Thanks for the clarification. For future PRs it would make it easier for the reviewer if what it intends to solve is specified in the first comment (it seems like this was discussed elsewhere, in which case do link to it). Besides the Enums (which is being discussed in #1784) I believe this is ready to merge as soon as tests pass. |
This PR originally had a completely different scope, so you're absolutely correct—it ended up getting quite tangled with multiple different PRs and issues addressing the same topic. My apologies for the confusion. Only #1777 is failing, but that's expected |
That's fixed in the latest commit in main. Feel free to copy that small commit over. |
* skip AfriSentiLID for now * skip relevant test case instead --------- Co-authored-by: Isaac Chung <[email protected]>
There seems to be a conflict. @sam-hey if you resolve this remove the Enum part we can merge this in. This is not at all a hard decision on Enums, but I think with two major merges coming up, this will cause a lot of conflicts (cc. @Samoed, @gowitheflow-1998). We can still do the transition after the merge (outlined in #1784). |
@KennethEnevoldsen, what do you think about merging it in its current state? I’ve kept the Enum but reverted the changes in all the models. Personally, I think this is a good compromise. Backward compatibility is fully maintained. |
Model loading test has been fixed here in main as well: #1775 |
@isaac-chung I've merged your updates to |
All |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Thanks a lot to all of you, @KennethEnevoldsen, @isaac-chung, and @Samoed! I have one more question: I believe it would be beneficial to add BM25 and ColBERT tests to the pipeline. I’ve read that the pipeline is currently taking too long, and I’d like to know your thoughts on incorporating the BM25 and ColBERT requirements into the What do you think? |
I think they can be integrated, but let's make separate PR |
ce5cb3e
into
embeddings-benchmark:v2.0.0
Great work on this @sam-hey! Thanks for taking the time |
Checklist
Run tests locally to make sure nothing is broken using
make test
.Run the formatter to format the code using
make lint
.fix: Retrieve
name
andrevision
from SentenceTransformers metadata.mv: Move the
get_similarity_function
method toModelMeta
.fix: Resolve issues with
bm25s
.feat: Add a
max_similarity
function toutils.py
.feat: Map and load SentenceTransformers similarity functions to MTEB similarity functions.
ref: Changed
max_sim
toMaxSim
to align with thepylate
implementation ofsimilarity_fn_name
Update similarity_fn_name = 'cosine' to MaxSim lightonai/pylate#77test: add test for ColBERT and bm25s