Update README.md
Browse files
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
library_name:
|
3 |
tags:
|
4 |
- gte
|
5 |
- mteb
|
@@ -2636,6 +2636,8 @@ We also present the [`gte-Qwen1.5-7B-instruct`](https://huggingface.co/Alibaba-N
|
|
2636 |
Use the code below to get started with the model.
|
2637 |
|
2638 |
```python
|
|
|
|
|
2639 |
import torch.nn.functional as F
|
2640 |
from transformers import AutoModel, AutoTokenizer
|
2641 |
|
@@ -2662,12 +2664,14 @@ scores = (embeddings[:1] @ embeddings[1:].T) * 100
|
|
2662 |
print(scores.tolist())
|
2663 |
```
|
2664 |
|
2665 |
-
**It is recommended to install xformers and enable unpadding for acceleration, refer to [enable-unpadding-and-xformers](https://huggingface.co/Alibaba-NLP/
|
2666 |
|
2667 |
|
2668 |
Use with `sentence-transformers`:
|
2669 |
|
2670 |
```python
|
|
|
|
|
2671 |
from sentence_transformers import SentenceTransformer
|
2672 |
from sentence_transformers.util import cos_sim
|
2673 |
|
|
|
1 |
---
|
2 |
+
library_name: transformers
|
3 |
tags:
|
4 |
- gte
|
5 |
- mteb
|
|
|
2636 |
Use the code below to get started with the model.
|
2637 |
|
2638 |
```python
|
2639 |
+
# Requires transformers>=4.36.0
|
2640 |
+
|
2641 |
import torch.nn.functional as F
|
2642 |
from transformers import AutoModel, AutoTokenizer
|
2643 |
|
|
|
2664 |
print(scores.tolist())
|
2665 |
```
|
2666 |
|
2667 |
+
**It is recommended to install xformers and enable unpadding for acceleration, refer to [enable-unpadding-and-xformers](https://huggingface.co/Alibaba-NLP/new-impl#recommendation-enable-unpadding-and-acceleration-with-xformers).**
|
2668 |
|
2669 |
|
2670 |
Use with `sentence-transformers`:
|
2671 |
|
2672 |
```python
|
2673 |
+
# Requires sentence_transformers>=2.7.0
|
2674 |
+
|
2675 |
from sentence_transformers import SentenceTransformer
|
2676 |
from sentence_transformers.util import cos_sim
|
2677 |
|