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

fix: Added gte models #1539

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 146 additions & 0 deletions mteb/models/gte_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,150 @@
similarity_fn_name="cosine",
framework=["Sentence Transformers", "PyTorch"],
use_instructions=True,
adapted_from="Qwen/Qwen2-7B",
supersedes="Alibaba-NLP/gte-Qwen1.5-7B-instruct",
)


gte_Qwen15_7B_instruct = ModelMeta(
loader=partial(
instruct_wrapper,
model_name_or_path="Alibaba-NLP/gte-Qwen1.5-7B-instruct",
instruction_template="Instruct: {instruction}\nQuery: ",
attn="cccc",
pooling_method="lasttoken",
mode="embedding",
torch_dtype="auto",
normalized=True,
),
name="Alibaba-NLP/gte-Qwen1.5-7B-instruct",
languages=None,
open_weights=True,
revision="07d27e5226328010336563bc1b564a5e3436a298",
release_date="2024-06-20", # initial commit of hf model
n_parameters=7_613_000_000,
memory_usage=None,
embed_dim=3584,
license="apache-2.0",
reference="https://huggingface.co/Alibaba-NLP/gte-Qwen2-7B-instruct",
similarity_fn_name="cosine",
framework=["Sentence Transformers", "PyTorch"],
use_instructions=True,
adapted_from="Qwen/Qwen1.5-7B",
supersedes=None,
)

gte_base_en_v15 = ModelMeta(
name="Alibaba-NLP/gte-base-en-v1.5",
languages=["eng-Latn"],
open_weights=True,
revision="a829fd0e060bb84554da0dfd354d0de0f7712b7f", # can be any
release_date="2024-06-20", # initial commit of hf model
n_parameters=137_000_000,
memory_usage=None,
embed_dim=768,
license="apache-2.0",
max_tokens=8192,
reference="https://huggingface.co/Alibaba-NLP/gte-base-en-v1.5",
similarity_fn_name="cosine",
framework=["Sentence Transformers", "PyTorch"],
use_instructions=False,
supersedes=None,
adapted_from=None,
)

gte_multilingual_base = ModelMeta(
name="Alibaba-NLP/gte-multilingual-base",
# lang codes from model card and converted to three letter codes
languages=[
"afr-Latn",
"ara-Latn",
"aze-Latn",
"bel-Latn",
"bul-Latn",
"ben-Latn",
"cat-Latn",
"ceb-Latn",
"ces-Latn",
"cym-Latn",
"dan-Latn",
"deu-Latn",
"ell-Latn",
"eng-Latn",
"spa-Latn",
"est-Latn",
"eus-Latn",
"fas-Latn",
"fin-Latn",
"fra-Latn",
"glg-Latn",
"guj-Latn",
"heb-Latn",
"hin-Latn",
"hrv-Latn",
"hat-Latn",
"hun-Latn",
"hye-Latn",
"ind-Latn",
"isl-Latn",
"ita-Latn",
"jpn-Latn",
"jav-Latn",
"kat-Latn",
"kaz-Latn",
"khm-Latn",
"kan-Latn",
"kor-Latn",
"kir-Latn",
"lao-Latn",
"lit-Latn",
"lav-Latn",
"mkd-Latn",
"mal-Latn",
"mon-Latn",
"mar-Latn",
"msa-Latn",
"mya-Latn",
"nep-Latn",
"nld-Latn",
"nor-Latn",
"pan-Latn",
"pol-Latn",
"por-Latn",
"que-Latn",
"ron-Latn",
"rus-Latn",
"sin-Latn",
"slk-Latn",
"slv-Latn",
"som-Latn",
"sqi-Latn",
"srp-Latn",
"swe-Latn",
"swa-Latn",
"tam-Latn",
"tel-Latn",
"tha-Latn",
"tgl-Latn",
"tur-Latn",
"ukr-Latn",
"urd-Latn",
"vie-Latn",
"yor-Latn",
"zho-Latn",
],
open_weights=True,
revision="a829fd0e060bb84554da0dfd354d0de0f7712b7f", # can be any
release_date="2024-06-20", # initial commit of hf model
n_parameters=137_000_000,
memory_usage=None,
embed_dim=768,
license="apache-2.0",
max_tokens=8192,
reference="https://huggingface.co/Alibaba-NLP/gte-multilingual-base",
similarity_fn_name="cosine",
framework=["Sentence Transformers", "PyTorch"],
use_instructions=False,
supersedes=None,
adapted_from=None,
)
51 changes: 51 additions & 0 deletions mteb/models/mxbai_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,55 @@
similarity_fn_name="cosine",
framework=["Sentence Transformers", "PyTorch"],
use_instructions=True,
adapted_from=None,
supersedes=None,
)

mxbai_embed_2d_large_v1 = ModelMeta(
loader=partial(
sentence_transformers_loader,
model_name="mixedbread-ai/mxbai-embed-2d-large-v1",
revision="7e639ca8e344af398876ead3b19ec3c0b9068f49",
),
name="mixedbread-ai/mxbai-embed-2d-large-v1",
languages=["eng_Latn"],
open_weights=True,
revision="7e639ca8e344af398876ead3b19ec3c0b9068f49",
release_date="2024-03-04", # initial commit of hf model.
n_parameters=335_000_000,
memory_usage=None,
max_tokens=512,
embed_dim=768,
license="apache-2.0",
reference="https://huggingface.co/mixedbread-ai/mxbai-embed-2d-large-v1",
similarity_fn_name="cosine",
framework=["Sentence Transformers", "PyTorch"],
use_instructions=True,
adapted_from=None,
supersedes=None,
)


mxbai_embed_xsmall_v1 = ModelMeta(
loader=partial(
sentence_transformers_loader,
model_name="mixedbread-ai/mxbai-embed-xsmall-v1",
revision="2f741ec33328bb57e4704e1238fc59a4a5745705",
),
name="mixedbread-ai/mxbai-embed-xsmall-v1",
languages=["eng_Latn"],
open_weights=True,
revision="2f741ec33328bb57e4704e1238fc59a4a5745705",
release_date="2024-08-13", # initial commit of hf model.
n_parameters=24_100_000,
memory_usage=None,
max_tokens=512,
embed_dim=384,
license="apache-2.0",
reference="https://huggingface.co/mixedbread-ai/mxbai-embed-xsmall-v1",
similarity_fn_name="cosine",
framework=["Sentence Transformers", "PyTorch"],
use_instructions=True,
adapted_from="sentence-transformers/all-MiniLM-L6-v2",
supersedes=None,
)
Loading