MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / _embeddings_from_pointer

Method _embeddings_from_pointer

examples/server/server.py:10848–10853  ·  view source on GitHub ↗
(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:

Callers 1

_encode_media_batchMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected