-
Notifications
You must be signed in to change notification settings - Fork 655
qzhou-embedding model_meta & implementation #2975
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
Merged
Samoed
merged 12 commits into
embeddings-benchmark:main
from
PennyYu123:qzhou-embedding-model-meta
Aug 7, 2025
Merged
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
762c907
qzhou-embedding model_meta & implementation
PennyYu123 493e8ec
Update qzhou_models.py
PennyYu123 26c5e9b
Update qzhou_models.py
PennyYu123 88822b8
Update qzhou_models.py
PennyYu123 b33036c
Update qzhou_models.py
PennyYu123 6b22885
Update qzhou_models.py
PennyYu123 45006bf
Update qzhou_models.py
PennyYu123 be013cf
Update qzhou_models.py
PennyYu123 2a7ecbe
Update qzhou_models.py
PennyYu123 0661f83
Update mteb/models/qzhou_models.py
PennyYu123 f13924d
Update mteb/models/qzhou_models.py
PennyYu123 6f99b64
format qzhou_models.py for ruff check
PennyYu123 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 hidden or 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 hidden or 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,67 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import os | ||
| from functools import partial | ||
| from mteb.model_meta import ModelMeta | ||
| from mteb.encoder_interface import PromptType | ||
| from mteb.models.instruct_wrapper import InstructSentenceTransformerWrapper | ||
| from mteb.models.e5_instruct import E5_MISTRAL_TRAINING_DATA | ||
| from mteb.models.bge_models import bge_m3_training_data, bge_full_data, bge_chinese_training_data | ||
|
|
||
| def instruction_template( | ||
| instruction: str, prompt_type: PromptType | None = None | ||
| ) -> str: | ||
| if not instruction or prompt_type == PromptType.passage: | ||
| return "" | ||
| if isinstance(instruction, dict): | ||
| if prompt_type is None: | ||
| instruction = "Given a web search query, retrieve relevant passages that answer the query" | ||
| else: | ||
| instruction = instruction[prompt_type] | ||
| return f"Instruct: {instruction}\nQuery:" | ||
|
|
||
|
|
||
|
|
||
| def qzhou_instruct_loader(model_name, **kwargs): | ||
| model = InstructSentenceTransformerWrapper( | ||
| model_name, | ||
| revision=kwargs.pop("revision", None), | ||
| instruction_template=kwargs.pop("instruction_template", None), | ||
| apply_instruction_to_passages=False, | ||
| **kwargs, | ||
| ) | ||
| return model | ||
|
|
||
| QZhou_Embedding = ModelMeta( | ||
| loader = partial( | ||
| qzhou_instruct_loader, | ||
| model_name="Kingsoft-LLM/QZhou-Embedding", | ||
| revision="b43142d518d6e5251fd2d1e0a8741eef5c8b980a", | ||
| instruction_template=instruction_template | ||
| ), | ||
| name="Kingsoft-LLM/QZhou-Embedding", | ||
| languages=["eng-Latn", "zho-Hans"], | ||
| open_weights=True, | ||
| revision="b43142d518d6e5251fd2d1e0a8741eef5c8b980a", | ||
| release_date="2025-08-01", | ||
| n_parameters=7_070_619_136, | ||
| memory_usage_mb=29070, | ||
| embed_dim=3584, | ||
| license="apache-2.0", | ||
| max_tokens=8192, | ||
| reference="https://huggingface.co/Kingsoft-LLM/QZhou-Embedding", | ||
| similarity_fn_name="cosine", | ||
| framework=["Sentence Transformers", "PyTorch"], | ||
| use_instructions=True, | ||
| public_training_code=None, | ||
| public_training_data="https://huggingface.co/datasets/cfli/bge-full-data", | ||
| training_datasets={ | ||
| **bge_m3_training_data, | ||
| **bge_chinese_training_data, | ||
| **bge_full_data, | ||
| **E5_MISTRAL_TRAINING_DATA, | ||
| "Shitao/MLDR": ["train"], | ||
| "FreedomIntelligence/Huatuo26M-Lite": ["train"], | ||
| "infgrad/retrieval_data_llm": ["train"], | ||
|
PennyYu123 marked this conversation as resolved.
Outdated
|
||
| }, | ||
| ) | ||
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.
Uh oh!
There was an error while loading. Please reload this page.