Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/clm/embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ def __init__(self, url: str = "http://127.0.0.1:8090/v1/embeddings", model: str
def _fetch(self, texts: list[str]) -> tuple[list[np.ndarray], int]:
body: dict[str, Any] = {"model": self.model, "input": texts, "encoding_format": "base64"}
if self.max_tokens:
# Keep the tail, as the training recipe does: the question sits at the end of a
# state text. vLLM's pooling runner cuts from the right by default since 0.13.
body["truncate_prompt_tokens"] = self.max_tokens
body["truncation_side"] = "left"
try:
r = self.session.post(self.url, json=body, timeout=self.timeout)
except requests.RequestException as e:
Expand Down