Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add batch inference support (WIP) #951

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ High-level Python bindings for llama.cpp.
- token_eos
show_root_heading: true

::: llama_cpp.LlamaGrammar
options:
members:
- from_string
- from_json_schema

::: llama_cpp.LlamaCache
options:
show_root_heading: true

::: llama_cpp.LlamaState
options:
show_root_heading: true
Expand All @@ -58,6 +48,13 @@ High-level Python bindings for llama.cpp.
options:
show_root_heading: true

::: llama_cpp.LlamaGrammar
options:
members:
- from_string
- from_json_schema


## Low Level API

Low-level Python bindings for llama.cpp using Python's ctypes library.
Expand Down
2 changes: 1 addition & 1 deletion llama_cpp/_internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,4 +767,4 @@ def sample(
def accept(self, ctx_main: _LlamaContext, id: int, apply_grammar: bool):
if apply_grammar and self.grammar is not None:
ctx_main.grammar_accept_token(self.grammar, id)
self.prev.append(id)
self.prev.append(id)
Loading