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

Method longest_token_prefix

llama_cpp/llama.py:2306–2313  ·  view source on GitHub ↗
(a: Sequence[int], b: Sequence[int])

Source from the content-addressed store, hash-verified

2304
2305 @staticmethod
2306 def longest_token_prefix(a: Sequence[int], b: Sequence[int]):
2307 longest_prefix = 0
2308 for _a, _b in zip(a, b):
2309 if _a == _b:
2310 longest_prefix += 1
2311 else:
2312 break
2313 return longest_prefix
2314
2315 @classmethod
2316 def from_pretrained(

Callers 3

_create_completionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected