Back to the room

Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works

Code Observatory / method

_encode

codeintel.embeddings.SentenceTransformerEmbedder._encode

PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.

PHAROS at 975a38dMIT license

Around this symbol

Search all symbols

Loading

Calls (1)
SymbolFileResolved by
_padembeddings.pysame file
Called by (3)
SymbolFileResolved by
embed_documentsembeddings.pysame file
embed_queryembeddings.pysame file
encode_rawembeddings.pysame file
Inside (1)
SymbolFileResolved by
SentenceTransformerEmbedderembeddings.pysame file
codeintel.embeddings.SentenceTransformerEmbedder._encodebackend/app/codeintel/embeddings.py, lines 211–220Open source
    def _encode(self, texts: list[str]) -> list[list[float]]:        model = self._load()        vectors = model.encode(            texts,            batch_size=self.batch_size,            normalize_embeddings=True,            show_progress_bar=False,            convert_to_numpy=True,        )        return [_pad(v.tolist(), self.dim) for v in vectors]

What the index recorded

Signature
def _encode(self, texts: list[str]) -> list[list[float]]:
File
backend/app/codeintel/embeddings.py
Lines
211–220
Parser
python-ast
Git blob
df7f8202f23ca6ad2c57aca5f09b435eb6486d79
Call sites
4 named, 2 resolved, 2 left unlinked
Outside this subset
2 more edges reach code outside the graph shown here

Read it on GitHub at this commit