Update README.md
Browse files
README.md
CHANGED
@@ -102,7 +102,7 @@ from scipy.spatial.distance import cdist
|
|
102 |
retriever = pipeline('feature-extraction', 'cmarkea/bloomz-560m-retriever-v2')
|
103 |
|
104 |
# Inportant: take only last token!
|
105 |
-
infer = lambda x: [ii[0][-1] for ii in retriever(x)]
|
106 |
|
107 |
list_of_contexts: List[str] = [...]
|
108 |
emb_contexts = np.concatenate(infer(list_of_contexts), axis=0)
|
|
|
102 |
retriever = pipeline('feature-extraction', 'cmarkea/bloomz-560m-retriever-v2')
|
103 |
|
104 |
# Inportant: take only last token!
|
105 |
+
infer = lambda x: [np.array(ii[0][-1]).reshape(1,-1) for ii in retriever(x)]
|
106 |
|
107 |
list_of_contexts: List[str] = [...]
|
108 |
emb_contexts = np.concatenate(infer(list_of_contexts), axis=0)
|