sentence-transformers
ONNX
Safetensors
ColBERT
multi-vector
passage-retrieval
custom_code
🇪🇺 Region: EU
Instructions to use jinaai/jina-colbert-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use jinaai/jina-colbert-v2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("jinaai/jina-colbert-v2", trust_remote_code=True) sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
docs: add pylate example usage (#8)
Browse files- Update README.md (f76d01524d64108451097bb74b17681af7cff771)
README.md
CHANGED
|
@@ -136,12 +136,28 @@ JinaColBERT V2 offers three different versions for different embeddings dimensio
|
|
| 136 |
|
| 137 |
`jina-colbert-v2` is trained with flash attention and therefore requires `einops` and `flash_attn` to be installed.
|
| 138 |
|
| 139 |
-
To use the model, you could either use the Standford ColBERT library or use the `ragatouille` package that we provide.
|
| 140 |
|
| 141 |
```bash
|
| 142 |
pip install -U einops flash_attn
|
| 143 |
-
pip install -U ragatouille
|
| 144 |
-
pip install -U colbert-ai
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
```
|
| 146 |
|
| 147 |
### RAGatouille
|
|
|
|
| 136 |
|
| 137 |
`jina-colbert-v2` is trained with flash attention and therefore requires `einops` and `flash_attn` to be installed.
|
| 138 |
|
| 139 |
+
To use the model, you could either use the Standford ColBERT library or use the `pylate`/`ragatouille` package that we provide.
|
| 140 |
|
| 141 |
```bash
|
| 142 |
pip install -U einops flash_attn
|
| 143 |
+
pip install -U ragatouille # or
|
| 144 |
+
pip install -U colbert-ai # or
|
| 145 |
+
pip install -U pylate
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
### PyLate
|
| 149 |
+
|
| 150 |
+
```python
|
| 151 |
+
# Please refer to Pylate: https://github.com/lightonai/pylate for detailed usage
|
| 152 |
+
from pylate import indexes, models, retrieve
|
| 153 |
+
|
| 154 |
+
model = models.ColBERT(
|
| 155 |
+
model_name_or_path="jinaai/jina-colbert-v2",
|
| 156 |
+
query_prefix="[QueryMarker]",
|
| 157 |
+
document_prefix="[DocumentMarker]",
|
| 158 |
+
attend_to_expansion_tokens=True,
|
| 159 |
+
trust_remote_code=True,
|
| 160 |
+
)
|
| 161 |
```
|
| 162 |
|
| 163 |
### RAGatouille
|