MCPcopy
hub / github.com/MinishLab/semble / encode

Method encode

benchmarks/speed_benchmark.py:83–88  ·  view source on GitHub ↗

Encode with query prompt for single items, document prompt for batches.

(self, texts: Sequence[str], /)

Source from the content-addressed store, hash-verified

81 self._model.max_seq_length = max_seq_length
82
83 def encode(self, texts: Sequence[str], /) -> EmbeddingMatrix:
84 """Encode with query prompt for single items, document prompt for batches."""
85 text_list = list(texts)
86 if len(text_list) == 1:
87 return self._model.encode(text_list, prompt_name="query", batch_size=1) # type: ignore[return-value]
88 return self._model.encode(text_list, batch_size=1) # type: ignore[return-value]
89
90
91def _bench_semble(

Callers 10

_search_semanticFunction · 0.45
embed_chunksFunction · 0.45
_json5_objectFunction · 0.45
_insert_first_memberFunction · 0.45
_reparse_okFunction · 0.45
merge_json_memberFunction · 0.45
chunkFunction · 0.45
_curveFunction · 0.45

Calls

no outgoing calls