Method
_embeddings_from_pointer
(self, output: Any, n_tokens: int)
Source from the content-addressed store, hash-verified
| 10846 | return tokens |
| 10847 | |
| 10848 | def _embeddings_from_pointer(self, output: Any, n_tokens: int) -> np.ndarray: |
| 10849 | flat = np.ctypeslib.as_array(output, shape=(n_tokens * self.n_embd_inp,)) |
| 10850 | return np.array(flat, dtype=np.float32, copy=True).reshape( |
| 10851 | n_tokens, |
| 10852 | self.n_embd_inp, |
| 10853 | ) |
| 10854 | |
| 10855 | def _load_cached_media_chunk(self, media_chunk: "MTMDProcessor.MediaChunk") -> bool: |
| 10856 | if self.embedding_cache is None: |
Tested by
no test coverage detected