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

Method is_reusable_boundary

examples/server/server.py:3976–3981  ·  view source on GitHub ↗
(self, pos: int)

Source from the content-addressed store, hash-verified

3974 return any(segment.start_pos == pos or segment.end_pos == pos for segment in self.segments)
3975
3976 def is_reusable_boundary(self, pos: int) -> bool:
3977 if pos <= 0 or pos >= self.length:
3978 return True
3979 if self.is_boundary(pos):
3980 return True
3981 return self.segment_at(pos).kind == "text"
3982
3983 def clamp_to_reusable_boundary(self, pos: int) -> int:
3984 if pos <= 0:

Callers 3

decoder_pos_up_toMethod · 0.95

Calls 2

is_boundaryMethod · 0.95
segment_atMethod · 0.95

Tested by

no test coverage detected