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 0998ea0

Browse filesBrowse files
committed
fix: grammar prints on each call. Closes abetlen#1666
1 parent bfb42b7 commit 0998ea0
Copy full SHA for 0998ea0

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed

‎llama_cpp/llama_grammar.py

Copy file name to clipboardExpand all lines: llama_cpp/llama_grammar.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,8 @@ def reset(self):
890890
@classmethod
891891
def from_string(cls, grammar: str, verbose: bool = True) -> "LlamaGrammar":
892892
parsed_grammar = parse(grammar)
893-
print_grammar(file=sys.stdout, state=parsed_grammar)
893+
if verbose:
894+
print_grammar(file=sys.stdout, state=parsed_grammar)
894895
return cls(parsed_grammar)
895896

896897
@classmethod

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.