MCPcopy Index your code
hub / github.com/abetlen/llama-cpp-python / join_seq

Method join_seq

llama_cpp/llama_grammar.py:549–559  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

547 return self._add_rule(f"dot", rule)
548
549 def join_seq():
550 nonlocal seq
551 ret = []
552 for is_literal, g in groupby(seq, lambda x: x[1]):
553 if is_literal:
554 ret.append(("".join(x[0] for x in g), True))
555 else:
556 ret.extend(g)
557 if len(ret) == 1:
558 return ret[0]
559 return (" ".join(to_rule(x) for x in seq), False)
560
561 while i < length:
562 c = pattern[i]

Callers

nothing calls this directly

Calls 2

appendMethod · 0.80
extendMethod · 0.45

Tested by

no test coverage detected