Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dff186c

Browse files
ExtReMLapinabetlen
andauthored
feat: Ported back new grammar changes from C++ to Python implementation (abetlen#1637)
* Backported . (any chat) from llama.cpp * unfinished {count,optionalmax) * implemented slice function in std:vector * fixed mistake done while reading * ported ggml-org/llama.cpp#7194 * multiple fixes, var copy * Rewrite LlamaGrammar internals in python style * bugfix --------- Co-authored-by: Andrei <[email protected]>
1 parent 5575fed commit dff186c

File tree

2 files changed

+682
-972
lines changed

2 files changed

+682
-972
lines changed

llama_cpp/llama_cpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3002,7 +3002,7 @@ def llama_grammar_init(
30023002
n_rules: Union[ctypes.c_size_t, int],
30033003
start_rule_index: Union[ctypes.c_size_t, int],
30043004
/,
3005-
) -> llama_grammar_p:
3005+
) -> Optional[llama_grammar_p]:
30063006
"""Initialize a grammar from a set of rules."""
30073007
...
30083008

0 commit comments

Comments
 (0)