Feature Extraction
Transformers
PyTorch
Safetensors
French
English
bloom
text-generation-inference
Cyrile commited on
Commit
d7ab8b6
·
verified ·
1 Parent(s): 31cdd58

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +1 -1
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)