MCPcopy Create free account

hub / github.com/Dan-wanna-M/kbnf / functions

Functions238 in github.com/Dan-wanna-M/kbnf

Methodcompute_allowed_token_ids_js
(&mut self)
src/ffi_bindings.rs:350
Methodcompute_allowed_token_ids_py
(&mut self, py: Python<'_>)
src/ffi_bindings.rs:514
Methodconstruct_regex_first_bytes
( rules: &JaggedArray<HIRNode<TI>, Vec<usize>, 3>, id_to_regexes: &[FiniteStateAutomaton],
src/grammar.rs:611
Methodconstruct_regex_to_token_ids
( vocabulary: &Vocabulary, rules: &JaggedArray<HIRNode<TI>, Vec<usize>, 3>, id_to_rege
src/grammar.rs:514
Methodconstruct_suffix_automata_first_bytes
( id_to_suffix_automata: &[SuffixAutomaton], )
src/grammar.rs:686
Functionconvert_slice
(tensor:typing.Any)
python/kbnf/engine.py:32
Functioncriterion_benchmark
(c: &mut Criterion)
benches/profiler.rs:66
Functioncriterion_benchmark
(c: &mut Criterion)
benches/simple.rs:66
Methoddefault
()
src/config.rs:85
Methoddefault
()
src/vocabulary.rs:38
Methoddisallowed_token_ids_from_last_computation_py
(&self)
src/ffi_bindings.rs:541
Methoddiv
(self, _rhs: Self)
src/zero.rs:97
Methoddiv_assign
(&mut self, _rhs: Self)
src/zero.rs:103
Methodearley_complete_one_item
( grammar: &Grammar<TI>, to_be_completed_item: ToBeCompletedItem<TI, TSP>, postdot_ite
src/engine_base.rs:1177
Functionearly_regex
()
tests/test.rs:539
Functionescaped_character
()
tests/test.rs:352
Functionescaped_literal
()
tests/test.rs:268
Methodfill_torch_bitmask_py
(&mut self, bitmask_ptr: usize)
src/ffi_bindings.rs:824
Methodfmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/grammar.rs:265
Methodfmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/vocabulary.rs:55
Methodfmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/engine_base.rs:378
Methodfrom
(error: CreateEngineError)
src/ffi_bindings.rs:26
Methodfrom
(_: Zero)
src/zero.rs:32
Methodfrom_dfa_state_id_to_state_id
(state_id: StateID, stride2: usize)
src/engine_base.rs:885
Methodfrom_index_to_state_id
(index: usize)
src/engine_base.rs:881
Methodfrom_state_id_to_dfa_state_id
(state_id: TS, stride2: usize)
src/engine_base.rs:892
Methodfrom_state_id_to_index
(state_id: TS)
src/engine_base.rs:877
Methodfrom_state_id_to_suffix_automaton_node_id
(state_id: TS)
src/engine_base.rs:901
Methodfrom_str_radix
(str: &str, radix: u32)
src/zero.rs:141
Methodfrom_suffix_automaton_node_id_to_state_id
(node_id: usize)
src/engine_base.rs:897
Methodget_allowed_token_ids_from_last_computation
(self)
python/kbnf/engine.py:118
Methodget_disallowed_token_ids_from_last_computation
(self)
python/kbnf/engine.py:124
Functionget_display_form_from_bitset
(bitset: &fixedbitset_stack::FixedBitSet)
src/utils.rs:125
Methodget_index_of_allowed_token_ids_py
(&self)
src/ffi_bindings.rs:553
Methodget_number_of_allowed_token_ids_py
(&self)
src/ffi_bindings.rs:591
Methodget_number_of_disallowed_token_ids_py
(&self)
src/ffi_bindings.rs:581
Methodget_vocab
(self)
python/kbnf/engine.py:151
Functionindirect_right_recursion
()
tests/test.rs:388
Methodinitialize_state_id_based_on_node
(grammar: &Grammar<TI>, node: HIRNode<TI>)
src/engine_base.rs:662
Methodinterned_strings
Get the interned strings.
src/grammar.rs:757
Methodinto_boxed_engine
(self)
src/engine.rs:267
Methodinto_boxed_engine
(self)
src/engine_base.rs:1924
Methodis_finished
(self)
python/kbnf/engine.py:148
Methodis_finished
(&self)
src/engine.rs:259
Methodis_finished_js
(&self)
src/ffi_bindings.rs:366
Methodis_finished_py
(&self)
src/ffi_bindings.rs:699
Methodis_rejected
( earley_sets: &EarleySets<TI, TD, TP, TSP, TS>, to_be_completed_items: &AHashSet<ToBeComplete
src/engine_base.rs:1287
Methodis_zero
(&self)
src/zero.rs:133
Methoditem_should_be_completed
( grammar: &Grammar<TI>, nonterminal_id: NonterminalID<TI>, new_dot_position: TD,
src/engine_base.rs:794
Functionkbnf
(m: &Bound<'_, PyModule>)
src/lib.rs:477
Functionleft_recursion
()
tests/test.rs:298
Functionlinked_list
()
tests/test.rs:603
Methodmask_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
Methodmask_logits
(&self, logits: &mut [f32])
src/engine.rs:229
Functionmask_logits_fast
(tensor:typing.Any, engine:"Engine")
python/kbnf/engine.py:45
Functionmask_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
Methodmask_logits_js
(&self, logits: &mut [f32])
src/ffi_bindings.rs:394
Methodmask_logits_py
( &self, logits_ptr: usize, length: usize, )
src/ffi_bindings.rs:744
Methodmax_value
()
src/zero.rs:53
Functionmiddle_recursion
()
tests/test.rs:425
Methodmin_value
()
src/zero.rs:49
Functionminimal_case
()
tests/test.rs:182
Functionminimal_case_with_accept_bytes
()
tests/test.rs:223
Methodmul
(self, _rhs: Self)
src/zero.rs:85
Methodmul_assign
(&mut self, _rhs: Self)
src/zero.rs:91
Methodnew
Create a new grammar from a simplified KBNF grammar and configuration. # Arguments `grammar` - The simplified KBNF grammar. `config` - The configura
src/grammar.rs:395
Methodnew
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
Methodnew
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
Methodnew
Create a new [EngineBase](crate::engine_base::EngineBase). # Arguments `vocabulary` - The vocabulary of the language model. `grammar` - The grammar
src/engine_base.rs:510
Methodnew_js
(value: Box<[u8]>)
src/ffi_bindings.rs:85
Methodnew_py
(value: &[u8])
src/ffi_bindings.rs:99
Methodnonterminal_str
Get the nonterminal string from the grammar.
src/grammar.rs:762
Methodone
()
src/zero.rs:123
Methodpredict
Run prediction stage of Earley algorithm on last Earley set and current `already_predicted_nonterminals` content
src/engine_base.rs:625
Methodpredict_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
Methodregex_str
Get the regex string from the grammar.
src/grammar.rs:776
Methodrem
(self, _rhs: Self)
src/zero.rs:111
Methodrem_assign
(&mut self, _rhs: Self)
src/zero.rs:117
Methodreset
(&mut self)
src/engine.rs:263
Methodreset_js
(&mut self)
src/ffi_bindings.rs:371
Methodreset_py
(&mut self)
src/ffi_bindings.rs:708
Methodrevert_change
( earley_sets: &mut EarleySets<TI, TD, TP, TSP, TS>, postdot_items: &mut AHashMap<Dotted<TI, T
src/engine_base.rs:1261
Functionright_recursion
()
tests/test.rs:315
Methodscan
( grammar: &Grammar<TI>, earley_sets: &mut EarleySets<TI, TD, TP, TSP, TS>, to_be_comp
src/engine_base.rs:905
Methodshrink_to_fit
(self)
python/kbnf/engine.py:154
Methodshrink_to_fit
Shrinks the memory of the engine. Used for benchmarking. # Signature (self) -> None
src/engine_base.rs:1367
Methodshrink_to_fit_py
(&mut self)
src/ffi_bindings.rs:851
Functionsingle_regex
()
tests/test.rs:106
Functionsingle_regex2
()
tests/test.rs:140
Functionsingle_terminal
()
tests/test.rs:71
Methodsub
(self, _rhs: Self)
src/zero.rs:73
Methodsub_assign
(&mut self, _rhs: Self)
src/zero.rs:79
Functionsubstrings
()
tests/test.rs:493
Methodsuffix_automata
Get the suffix automata from the grammar.
src/grammar.rs:795
Methodsuffix_automata_str
Get the suffix automata string from the grammar.
src/grammar.rs:783
Methodterminal_str
Get the terminal string from the grammar.
src/grammar.rs:769
Functiontest_ambiguous_grammar
()
tests/test.rs:703
Functiontest_json_string
()
tests/test.rs:693
Functiontest_regex_complement
()
tests/test.rs:635
Methodtoken_id_js
(&self, token: &Token)
src/ffi_bindings.rs:165
← previousnext →101–200 of 238, ranked by callers