Skip to content

Commit ebe395c

Browse files
committed
Remove add_grammar_lazy from _internals.py
1 parent 7ce56f6 commit ebe395c

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

llama_cpp/_internals.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,27 +1010,6 @@ def convert_list_str_to_char_array_ptr(self, str_list: List[str]):
10101010
# Return the char** pointer and the number of strings
10111011
return char_array_ptr, num_byte_list
10121012

1013-
def add_grammar_lazy(
1014-
self,
1015-
model: LlamaModel,
1016-
grammar: LlamaGrammar,
1017-
trigger_tokens:list[llama_cpp.llama_token],
1018-
num_trigger_tokens: int,
1019-
trigger_words: list[str]=[]
1020-
):
1021-
trigger_words_char_array_ptr, num_trigger_words = self.convert_list_str_to_char_array_ptr(trigger_words)
1022-
1023-
sampler = llama_cpp.llama_sampler_init_grammar_lazy(
1024-
model.vocab,
1025-
grammar._grammar.encode("utf-8"),
1026-
grammar._root.encode("utf-8"),
1027-
trigger_words_char_array_ptr,
1028-
num_trigger_words,
1029-
trigger_tokens,
1030-
num_trigger_tokens
1031-
)
1032-
self._add_sampler(sampler)
1033-
10341013
def add_grammar_lazy_patterns(
10351014
self,
10361015
model: LlamaModel,

0 commit comments

Comments
 (0)