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

Method load

examples/server/server.py:12567–12585  ·  view source on GitHub ↗
(
        self,
        match: SequenceCache.Match,
    )

Source from the content-addressed store, hash-verified

12565 )
12566
12567 def load(
12568 self,
12569 match: SequenceCache.Match,
12570 ) -> Optional[SequenceCache.Load]:
12571 entry = self._entries_by_tokens.get(match.tokens)
12572 if entry is None:
12573 return None
12574
12575 payload = self._read_entry_payload(entry)
12576 self._touch(entry)
12577 return SequenceCache.Load(
12578 tokens=payload.tokens,
12579 state_bytes=payload.state_bytes,
12580 prompt_logits=(
12581 np.asarray(payload.prompt_logits, dtype=np.float32)
12582 if payload.prompt_logits is not None
12583 else None
12584 ),
12585 )
12586
12587 def save(
12588 self,

Callers

nothing calls this directly

Calls 2

_read_entry_payloadMethod · 0.95
_touchMethod · 0.95

Tested by

no test coverage detected