Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Dan-wanna-M/kbnf
/ functions
Functions
238 in github.com/Dan-wanna-M/kbnf
⨍
Functions
238
◇
Types & classes
47
Method
compute_allowed_token_ids_js
(&mut self)
src/ffi_bindings.rs:350
Method
compute_allowed_token_ids_py
(&mut self, py: Python<'_>)
src/ffi_bindings.rs:514
Method
construct_regex_first_bytes
( rules: &JaggedArray<HIRNode<TI>, Vec<usize>, 3>, id_to_regexes: &[FiniteStateAutomaton],
src/grammar.rs:611
Method
construct_regex_to_token_ids
( vocabulary: &Vocabulary, rules: &JaggedArray<HIRNode<TI>, Vec<usize>, 3>, id_to_rege
src/grammar.rs:514
Method
construct_suffix_automata_first_bytes
( id_to_suffix_automata: &[SuffixAutomaton], )
src/grammar.rs:686
Function
convert_slice
(tensor:typing.Any)
python/kbnf/engine.py:32
Function
criterion_benchmark
(c: &mut Criterion)
benches/profiler.rs:66
Function
criterion_benchmark
(c: &mut Criterion)
benches/simple.rs:66
Method
default
()
src/config.rs:85
Method
default
()
src/vocabulary.rs:38
Method
disallowed_token_ids_from_last_computation_py
(&self)
src/ffi_bindings.rs:541
Method
div
(self, _rhs: Self)
src/zero.rs:97
Method
div_assign
(&mut self, _rhs: Self)
src/zero.rs:103
Method
earley_complete_one_item
( grammar: &Grammar<TI>, to_be_completed_item: ToBeCompletedItem<TI, TSP>, postdot_ite
src/engine_base.rs:1177
Function
early_regex
()
tests/test.rs:539
Function
escaped_character
()
tests/test.rs:352
Function
escaped_literal
()
tests/test.rs:268
Method
fill_torch_bitmask_py
(&mut self, bitmask_ptr: usize)
src/ffi_bindings.rs:824
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/grammar.rs:265
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/vocabulary.rs:55
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/engine_base.rs:378
Method
from
(error: CreateEngineError)
src/ffi_bindings.rs:26
Method
from
(_: Zero)
src/zero.rs:32
Method
from_dfa_state_id_to_state_id
(state_id: StateID, stride2: usize)
src/engine_base.rs:885
Method
from_index_to_state_id
(index: usize)
src/engine_base.rs:881
Method
from_state_id_to_dfa_state_id
(state_id: TS, stride2: usize)
src/engine_base.rs:892
Method
from_state_id_to_index
(state_id: TS)
src/engine_base.rs:877
Method
from_state_id_to_suffix_automaton_node_id
(state_id: TS)
src/engine_base.rs:901
Method
from_str_radix
(str: &str, radix: u32)
src/zero.rs:141
Method
from_suffix_automaton_node_id_to_state_id
(node_id: usize)
src/engine_base.rs:897
Method
get_allowed_token_ids_from_last_computation
(self)
python/kbnf/engine.py:118
Method
get_disallowed_token_ids_from_last_computation
(self)
python/kbnf/engine.py:124
Function
get_display_form_from_bitset
(bitset: &fixedbitset_stack::FixedBitSet)
src/utils.rs:125
Method
get_index_of_allowed_token_ids_py
(&self)
src/ffi_bindings.rs:553
Method
get_number_of_allowed_token_ids_py
(&self)
src/ffi_bindings.rs:591
Method
get_number_of_disallowed_token_ids_py
(&self)
src/ffi_bindings.rs:581
Method
get_vocab
(self)
python/kbnf/engine.py:151
Function
indirect_right_recursion
()
tests/test.rs:388
Method
initialize_state_id_based_on_node
(grammar: &Grammar<TI>, node: HIRNode<TI>)
src/engine_base.rs:662
Method
interned_strings
Get the interned strings.
src/grammar.rs:757
Method
into_boxed_engine
(self)
src/engine.rs:267
Method
into_boxed_engine
(self)
src/engine_base.rs:1924
Method
is_finished
(self)
python/kbnf/engine.py:148
Method
is_finished
(&self)
src/engine.rs:259
Method
is_finished_js
(&self)
src/ffi_bindings.rs:366
Method
is_finished_py
(&self)
src/ffi_bindings.rs:699
Method
is_rejected
( earley_sets: &EarleySets<TI, TD, TP, TSP, TS>, to_be_completed_items: &AHashSet<ToBeComplete
src/engine_base.rs:1287
Method
is_zero
(&self)
src/zero.rs:133
Method
item_should_be_completed
( grammar: &Grammar<TI>, nonterminal_id: NonterminalID<TI>, new_dot_position: TD,
src/engine_base.rs:794
Function
kbnf
(m: &Bound<'_, PyModule>)
src/lib.rs:477
Function
left_recursion
()
tests/test.rs:298
Function
linked_list
()
tests/test.rs:603
Method
mask_logits
Masks the logits based on last computed token IDs. These token IDs can also be obtained from [`EngineLike::allowed_token_ids_from_last_computation`].
python/kbnf/engine.py:160
Method
mask_logits
(&self, logits: &mut [f32])
src/engine.rs:229
Function
mask_logits_fast
(tensor:typing.Any, engine:"Engine")
python/kbnf/engine.py:45
Function
mask_logits_inplace
Masks logits in-place using token bitmasks filled by KBNF engines. This function fills token bitmasks by KBNF engines and applies them t
python/kbnf/triton_logits_mask.py:80
Method
mask_logits_js
(&self, logits: &mut [f32])
src/ffi_bindings.rs:394
Method
mask_logits_py
( &self, logits_ptr: usize, length: usize, )
src/ffi_bindings.rs:744
Method
max_value
()
src/zero.rs:53
Function
middle_recursion
()
tests/test.rs:425
Method
min_value
()
src/zero.rs:49
Function
minimal_case
()
tests/test.rs:182
Function
minimal_case_with_accept_bytes
()
tests/test.rs:223
Method
mul
(self, _rhs: Self)
src/zero.rs:85
Method
mul_assign
(&mut self, _rhs: Self)
src/zero.rs:91
Method
new
Create a new grammar from a simplified KBNF grammar and configuration. # Arguments `grammar` - The simplified KBNF grammar. `config` - The configura
src/grammar.rs:395
Method
new
Creates a new instance of [Vocabulary]. # Arguments `id_to_token` - A map from token IDs to tokens. `id_to_token_string` - A map from token IDs to t
src/vocabulary.rs:83
Method
new
Create a new [`Engine`] from an KBNF grammar string and a [`Vocabulary`]. # Arguments `kbnf_syntax_grammar_str` - The KBNF grammar string. `vocabul
src/engine.rs:90
Method
new
Create a new [EngineBase](crate::engine_base::EngineBase). # Arguments `vocabulary` - The vocabulary of the language model. `grammar` - The grammar
src/engine_base.rs:510
Method
new_js
(value: Box<[u8]>)
src/ffi_bindings.rs:85
Method
new_py
(value: &[u8])
src/ffi_bindings.rs:99
Method
nonterminal_str
Get the nonterminal string from the grammar.
src/grammar.rs:762
Method
one
()
src/zero.rs:123
Method
predict
Run prediction stage of Earley algorithm on last Earley set and current `already_predicted_nonterminals` content
src/engine_base.rs:625
Method
predict_nonterminal
Predict one nonterminal according to Earley algorithm on the last Earley set. This function ensures no duplication happens. Returns the number of ite
src/engine_base.rs:707
Method
regex_str
Get the regex string from the grammar.
src/grammar.rs:776
Method
rem
(self, _rhs: Self)
src/zero.rs:111
Method
rem_assign
(&mut self, _rhs: Self)
src/zero.rs:117
Method
reset
(&mut self)
src/engine.rs:263
Method
reset_js
(&mut self)
src/ffi_bindings.rs:371
Method
reset_py
(&mut self)
src/ffi_bindings.rs:708
Method
revert_change
( earley_sets: &mut EarleySets<TI, TD, TP, TSP, TS>, postdot_items: &mut AHashMap<Dotted<TI, T
src/engine_base.rs:1261
Function
right_recursion
()
tests/test.rs:315
Method
scan
( grammar: &Grammar<TI>, earley_sets: &mut EarleySets<TI, TD, TP, TSP, TS>, to_be_comp
src/engine_base.rs:905
Method
shrink_to_fit
(self)
python/kbnf/engine.py:154
Method
shrink_to_fit
Shrinks the memory of the engine. Used for benchmarking. # Signature (self) -> None
src/engine_base.rs:1367
Method
shrink_to_fit_py
(&mut self)
src/ffi_bindings.rs:851
Function
single_regex
()
tests/test.rs:106
Function
single_regex2
()
tests/test.rs:140
Function
single_terminal
()
tests/test.rs:71
Method
sub
(self, _rhs: Self)
src/zero.rs:73
Method
sub_assign
(&mut self, _rhs: Self)
src/zero.rs:79
Function
substrings
()
tests/test.rs:493
Method
suffix_automata
Get the suffix automata from the grammar.
src/grammar.rs:795
Method
suffix_automata_str
Get the suffix automata string from the grammar.
src/grammar.rs:783
Method
terminal_str
Get the terminal string from the grammar.
src/grammar.rs:769
Function
test_ambiguous_grammar
()
tests/test.rs:703
Function
test_json_string
()
tests/test.rs:693
Function
test_regex_complement
()
tests/test.rs:635
Method
token_id_js
(&self, token: &Token)
src/ffi_bindings.rs:165
← previous
next →
101–200 of 238, ranked by callers