Update README.md
Browse files
README.md
CHANGED
|
@@ -2638,6 +2638,8 @@ We also present the [`gte-Qwen1.5-7B-instruct`](https://huggingface.co/Alibaba-N
|
|
| 2638 |
Use the code below to get started with the model.
|
| 2639 |
|
| 2640 |
```python
|
|
|
|
|
|
|
| 2641 |
import torch.nn.functional as F
|
| 2642 |
from transformers import AutoModel, AutoTokenizer
|
| 2643 |
|
|
@@ -2664,12 +2666,14 @@ scores = (embeddings[:1] @ embeddings[1:].T) * 100
|
|
| 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/
|
| 2668 |
|
| 2669 |
|
| 2670 |
Use with sentence-transformers:
|
| 2671 |
|
| 2672 |
```python
|
|
|
|
|
|
|
| 2673 |
from sentence_transformers import SentenceTransformer
|
| 2674 |
from sentence_transformers.util import cos_sim
|
| 2675 |
|
|
|
|
| 2638 |
Use the code below to get started with the model.
|
| 2639 |
|
| 2640 |
```python
|
| 2641 |
+
# Requires transformers>=4.36.0
|
| 2642 |
+
|
| 2643 |
import torch.nn.functional as F
|
| 2644 |
from transformers import AutoModel, AutoTokenizer
|
| 2645 |
|
|
|
|
| 2666 |
print(scores.tolist())
|
| 2667 |
```
|
| 2668 |
|
| 2669 |
+
**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).**
|
| 2670 |
|
| 2671 |
|
| 2672 |
Use with sentence-transformers:
|
| 2673 |
|
| 2674 |
```python
|
| 2675 |
+
# Requires sentence_transformers>=2.7.0
|
| 2676 |
+
|
| 2677 |
from sentence_transformers import SentenceTransformer
|
| 2678 |
from sentence_transformers.util import cos_sim
|
| 2679 |
|