-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix: Enforce revision ID and model names for future contributions #56
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
results/voyageai__voyage-3-lite/no_revision_available/model_meta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"name": "voyageai__voyage-3-lite", "revision": "no_revision_available", "release_date": "2024-09-22", "languages": null, "n_parameters": null, "memory_usage": null, "max_tokens": 32000, "embed_dim": 512, "license": null, "open_source": false, "similarity_fn_name": null, "framework": [], "loader": "VoyageWrapper"} | ||
{"name": "voyageai/voyage-3-lite", "revision": "no_revision_available", "release_date": "2024-09-22", "languages": null, "n_parameters": null, "memory_usage": null, "max_tokens": 32000, "embed_dim": 512, "license": null, "open_source": false, "similarity_fn_name": null, "framework": [], "loader": "VoyageWrapper"} |
2 changes: 1 addition & 1 deletion
2
results/voyageai__voyage-3/no_revision_available/model_meta.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"name": "voyageai__voyage-3", "revision": "no_revision_available", "release_date": "2024-09-22", "languages": null, "n_parameters": null, "memory_usage": null, "max_tokens": 32000, "embed_dim": 1024, "license": null, "open_source": false, "similarity_fn_name": null, "framework": [], "loader": "VoyageWrapper"} | ||
{"name": "voyageai/voyage-3", "revision": "no_revision_available", "release_date": "2024-09-22", "languages": null, "n_parameters": null, "memory_usage": null, "max_tokens": 32000, "embed_dim": 1024, "license": null, "open_source": false, "similarity_fn_name": null, "framework": [], "loader": "VoyageWrapper"} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name": "voyageai/voyage-multilingual-2", "revision": "1", "release_date": "2024-06-10", "languages": null, "n_parameters": null, "memory_usage": null, "max_tokens": 32000, "embed_dim": 1024, "license": null, "open_source": false, "similarity_fn_name": null, "framework": [], "loader": "VoyageWrapper"} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,73 @@ | ||||||
import json | ||||||
|
||||||
import pytest | ||||||
|
||||||
from tests.test_correct_folder_structure import folders_without_meta, results_folder | ||||||
|
||||||
model_rev_pairs = [ | ||||||
(model_folder, rev_folder) | ||||||
for model_folder in results_folder.glob("*") | ||||||
for rev_folder in model_folder.glob("*") | ||||||
if model_folder.name not in [".DS_Store"] | ||||||
and rev_folder.name not in [".DS_Store"] | ||||||
and ((model_folder.name, rev_folder.name) not in folders_without_meta) | ||||||
] | ||||||
|
||||||
|
||||||
@pytest.mark.parametrize("model_rev_pair", model_rev_pairs) | ||||||
def test_model_meta_in_folders(model_rev_pair): | ||||||
""" | ||||||
Models added after the 26th of November should contain a model_meta.json file | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
""" | ||||||
model_folder, rev_folder = model_rev_pair | ||||||
|
||||||
meta_file = rev_folder / "model_meta.json" | ||||||
assert meta_file.exists() | ||||||
assert meta_file.is_file() | ||||||
assert meta_file.parent == rev_folder | ||||||
assert meta_file.suffix == ".json" | ||||||
assert meta_file.stem == "model_meta" | ||||||
|
||||||
|
||||||
# please do not add to this list, this is only for historic results, all new results should include a revision ID | ||||||
revision_exceptions = [ | ||||||
("castorini__mdpr-tied-pft-msmarco", "no_revision_available"), | ||||||
("voyageai__voyage-3", "no_revision_available"), | ||||||
("sentence-transformers__all-mpnet-base-v2", "no_revision_available"), | ||||||
("Snowflake__snowflake-arctic-embed-m-v1.5", "no_revision_available"), | ||||||
("sentence-transformers__all-MiniLM-L12-v2", "no_revision_available"), | ||||||
("nthakur__mcontriever-base-msmarco", "no_revision_available"), | ||||||
('voyageai__voyage-3-lite', 'no_revision_available') | ||||||
] | ||||||
|
||||||
|
||||||
@pytest.mark.parametrize("model_rev_pair", model_rev_pairs) | ||||||
def test_revision_is_specified_for_new_additions(model_rev_pair): | ||||||
""" | ||||||
Models added after 26th of November should include a revision ID and can not use the "no_revision_available" fallback. | ||||||
""" | ||||||
model_folder, rev_folder = model_rev_pair | ||||||
if (model_folder.name, rev_folder.name) not in revision_exceptions: | ||||||
meta_file = rev_folder / "model_meta.json" | ||||||
with meta_file.open("r") as f: | ||||||
meta = json.load(f) | ||||||
assert meta["revision"].lower() not in [ | ||||||
"no_revision_available", | ||||||
"", | ||||||
"na", | ||||||
"no-revision-available", | ||||||
] | ||||||
|
||||||
|
||||||
@pytest.mark.parametrize("model_rev_pair", model_rev_pairs) | ||||||
def test_organization_is_specified_for_new_additions(model_rev_pair): | ||||||
""" | ||||||
Models added after 26th of November should include a organization ID within their name, e.g. "myorg/my_embedding_model". | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
This is to avoid mispecified names such as "myorg__my_embedding_model" and similar. | ||||||
""" | ||||||
model_folder, rev_folder = model_rev_pair | ||||||
meta_file = rev_folder / "model_meta.json" | ||||||
with meta_file.open("r") as f: | ||||||
meta = json.load(f) | ||||||
assert "/" in meta["name"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Question: is that currently enforced? Or will only be in effect once the new leaderboard goes public?
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.
The new leaderboard does not fetch it automatically (only fetches from here)
However, we had a PR that fetches everything from HF (once, but probably not something we will run again).
E.g. the models:
'vectoriseai/bge-base-en-v1.5',
'vectoriseai/bge-large-en-v1.5',
'vectoriseai/bge-small-en',
'vectoriseai/bge-small-en-v1.5',
'vectoriseai/e5-base',
'vectoriseai/e5-base-v2',
'vectoriseai/e5-large',
'vectoriseai/e5-large-v2',
'vectoriseai/e5-small-v2',
'vectoriseai/gte-base',
'vectoriseai/gte-large',
'vectoriseai/gte-small',
'vectoriseai/multilingual-e5-large',
are all copies and then creates duplicates on the leaderboard.
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.
pr. #57 removes these