Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dff186c

Browse filesBrowse 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 <abetlen@gmail.com>
1 parent 5575fed commit dff186c
Copy full SHA for dff186c

File tree

Expand file treeCollapse file tree

2 files changed

+682
-972
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+682
-972
lines changed

‎llama_cpp/llama_cpp.py

Copy file name to clipboardExpand all lines: llama_cpp/llama_cpp.py
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.