docs: add pylate example usage

#8
by bwang0911 - opened
Files changed (1) hide show
  1. README.md +19 -3
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