MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / embed

Method embed

paperflow/providers/embedding.py:93–95  ·  view source on GitHub ↗
(self, text: str)

Source from the content-addressed store, hash-verified

91 self._model = SentenceTransformer(model, **kwargs)
92
93 def embed(self, text: str) -> List[float]:
94 vector = self._model.encode(text or " ", normalize_embeddings=True)
95 return _resize(list(vector.tolist() if hasattr(vector, "tolist") else vector), self.dimensions)
96
97 def embed_batch(self, texts: Iterable[str]) -> List[List[float]]:
98 items = [text or " " for text in texts]

Callers

nothing calls this directly

Calls 2

_resizeFunction · 0.85
encodeMethod · 0.80

Tested by

no test coverage detected