nirantk commited on
Commit
604ff39
1 Parent(s): 50ad142

Add Vector Creation Demo

Browse files
Files changed (1) hide show
  1. README.md +12 -0
README.md CHANGED
@@ -73,6 +73,18 @@ if __name__ == "__main__":
73
  indexer.index(name=index_name, collection=documents)
74
  ```
75
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  ### Searching
77
 
78
  ```python
 
73
  indexer.index(name=index_name, collection=documents)
74
  ```
75
 
76
+ ### Creating Vectors
77
+
78
+
79
+ ```python
80
+ from colbert.modeling.checkpoint import Checkpoint
81
+ ckpt = Checkpoint("jinaai/jina-colbert-v1-en", colbert_config=ColBERTConfig(root="experiments"))
82
+ queries = ckpt.queryFromText(["What does ColBERT do?", "This is a search query?"], bsize=16)
83
+ document_vectors = ckpt.docFromText(documents, bsize=32)[0]
84
+ ```
85
+
86
+ Complete working Colab Notebook is [here](https://colab.research.google.com/drive/1-5WGEYPSBNBg-Z0bGFysyvckFuM8imrg)
87
+
88
  ### Searching
89
 
90
  ```python