xinshuohu
commited on
Commit
·
5a3fe82
1
Parent(s):
edf22f4
feat: add vllm support
Browse files
README.md
CHANGED
|
@@ -65,25 +65,6 @@ extra_gated_eu_disallowed: true
|
|
| 65 |
- Pooling: lasttoken pooling
|
| 66 |
|
| 67 |
|
| 68 |
-
## Training Recipe
|
| 69 |
-
- High-quality supervised finetuning
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
## 📑 Open-source Plan
|
| 73 |
-
|
| 74 |
-
- [x] Model Checkpoint
|
| 75 |
-
- [x] [KaLM-embedding-multilingual-mini-v1](https://huggingface.co/HIT-TMG/KaLM-embedding-multilingual-mini-v1)
|
| 76 |
-
- [x] [KaLM-embedding-multilingual-mini-instruct-v1](https://huggingface.co/HIT-TMG/KaLM-embedding-multilingual-mini-instruct-v1)
|
| 77 |
-
- [x] [KaLM-embedding-multilingual-mini-instruct-v1.5](https://huggingface.co/HIT-TMG/KaLM-embedding-multilingual-mini-instruct-v1.5)
|
| 78 |
-
- [x] [KaLM-embedding-multilingual-mini-instruct-v2](https://huggingface.co/HIT-TMG/KaLM-embedding-multilingual-mini-instruct-v2)
|
| 79 |
-
- [x] [KaLM-embedding-multilingual-mini-instruct-v2.5](https://huggingface.co/KaLM-Embedding/KaLM-embedding-multilingual-mini-instruct-v2.5)
|
| 80 |
-
- [x] [KaLM-Embedding-Gemma3-12B-2511](https://huggingface.co/tencent/KaLM-Embedding-Gemma3-12B-2511)
|
| 81 |
-
- [x] Training and Evaluation Code: [HITsz-TMG/KaLM-Embedding](https://github.com/HITsz-TMG/KaLM-Embedding)
|
| 82 |
-
- [x] Technical Report: [KaLM-Embedding-V2: Superior Training Techniques and Data Inspire A Versatile Embedding Model](https://arxiv.org/abs/2506.20923v4)
|
| 83 |
-
- [x] Pre-training Data: [Pre-training Data](https://huggingface.co/datasets/HIT-TMG/KaLM-embedding-pretrain-data)
|
| 84 |
-
- [x] Fine-tuning Data: [Fine-tuning Data](https://huggingface.co/datasets/KaLM-Embedding/KaLM-embedding-finetuning-data)
|
| 85 |
-
|
| 86 |
-
|
| 87 |
## Usage
|
| 88 |
### sentence-transformers support
|
| 89 |
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
|
|
@@ -162,6 +143,27 @@ tensor([[0.9034, 0.2563],
|
|
| 162 |
'''
|
| 163 |
```
|
| 164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
|
| 166 |
## Citation
|
| 167 |
If you find this model useful, please consider giving a star and citation.
|
|
|
|
| 65 |
- Pooling: lasttoken pooling
|
| 66 |
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
## Usage
|
| 69 |
### sentence-transformers support
|
| 70 |
Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
|
|
|
|
| 143 |
'''
|
| 144 |
```
|
| 145 |
|
| 146 |
+
### vllm support
|
| 147 |
+
Note: Since [vllm](https://github.com/vllm-project/vllm/tree/main) only supports the [Gemma3ForCausalLM](https://huggingface.co/docs/transformers/en/model_doc/gemma3#transformers.Gemma3ForCausalLM) model class and not [Gemma3TextModel](https://huggingface.co/docs/transformers/en/model_doc/gemma3#transformers.Gemma3TextModel), model parameters must be loaded by specifying the CausalLM branch via `revision="CausalLM"`.
|
| 148 |
+
|
| 149 |
+
```python
|
| 150 |
+
from vllm import LLM
|
| 151 |
+
|
| 152 |
+
sentences = ["This is an example sentence", "Each sentence is converted"]
|
| 153 |
+
|
| 154 |
+
# Create an LLM.
|
| 155 |
+
# You should pass task="embed" for embedding models
|
| 156 |
+
model = LLM(
|
| 157 |
+
model="tencent/KaLM-Embedding-Gemma3-12B-2511",
|
| 158 |
+
task="embed",
|
| 159 |
+
enforce_eager=True,
|
| 160 |
+
revision="CausalLM", # specify the CausalLM branch for Gemma3ForCausalLM config
|
| 161 |
+
)
|
| 162 |
+
|
| 163 |
+
outputs = model.embed(sentences)
|
| 164 |
+
embeddings = [output.outputs.embedding for output in outputs]
|
| 165 |
+
```
|
| 166 |
+
|
| 167 |
|
| 168 |
## Citation
|
| 169 |
If you find this model useful, please consider giving a star and citation.
|