MCPcopy Create free account

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

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

↓ 62 callersMethodas_
(self)
src/zero.rs:17
↓ 30 callersMethodcompute_allowed_token_ids
(self)
python/kbnf/engine.py:121
↓ 24 callersMethodtry_accept_new_token
(self, token_id:int)
python/kbnf/engine.py:112
↓ 22 callersMethodtoken_id
Retrieves the token ID associated with the given token. # Arguments `token` - The token to retrieve the ID for. # Returns `Some(u32)` - The token
src/vocabulary.rs:223
↓ 19 callersMethodget
(&self)
src/zero.rs:43
↓ 18 callersFunctionread_rwkv_world_vocab
Read the vocabulary from RWKV-world model series vocabulary file.
tests/test.rs:30
↓ 14 callersFunctionrun_an_engine
(engine: &mut Engine, iteration: usize, token_id: u32, logits: &mut [f32])
benches/simple.rs:57
↓ 11 callersMethodto_display_form
Get the display form of the terminal id.
src/grammar.rs:49
↓ 10 callersMethodas_slice
(&self)
src/vocabulary.rs:30
↓ 9 callersMethodto_debug_form
(self, engine: &EngineBase<TN, TD, TP, TSP, TS>)
src/engine_base.rs:77
↓ 7 callersFunctionget_deterministic_display_form_from_hash_map
( map: &AHashMap<K, V>, process: impl FnMut((&K, &V)) -> (U, Y), )
src/utils.rs:138
↓ 7 callersMethodreset
(self)
python/kbnf/engine.py:157
↓ 6 callersMethodregex
Get the regex from the grammar.
src/grammar.rs:790
↓ 6 callersMethodvocab_size
Retrieves the size of the vocabulary.
src/vocabulary.rs:227
↓ 5 callersMethodtry_accept_new_bytes
(self, _bytes:bytes)
python/kbnf/engine.py:115
↓ 4 callersFunctionget_display_form_from_bitset_on_stack
( bitset: &FixedBitSet<NBLOCK>, )
src/utils.rs:119
↓ 3 callersFunctionfill_debug_form_of_id_to_x
( id_to_x: impl Iterator<Item = T> + 'a, get_str: impl Fn(usize) -> String, )
src/utils.rs:147
↓ 3 callersFunctionget_deterministic_display_form_from_hash_set
( set: &AHashSet<T>, process: impl FnMut(&T) -> U, )
src/utils.rs:129
↓ 3 callersMethodis_finished
(&self)
src/engine_base.rs:1890
↓ 3 callersMethodnode
Get the node from the grammar. # Panics Panics if the nonterminal id, dot position, or production id is out of bounds.
src/grammar.rs:717
↓ 3 callersMethodnode_unchecked
Get the node from the grammar without bounds checking. # Safety The caller must ensure that the nonterminal id, dot position, and production id are
src/grammar.rs:739
↓ 2 callersFunction_convert_logits_to_slice
(logits:typing.Any)
python/kbnf/engine.py:93
↓ 2 callersFunction_try_register_slice_converter
(module_name:str, obtain_converter:typing.Callable[[types.ModuleType],
python/kbnf/engine.py:11
↓ 2 callersMethoddotted_productions
( &self, nonterminal_id: NonterminalID<TI>, )
src/grammar.rs:879
↓ 2 callersMethodget_display_form_from_earley_sets
( &self, sets: &EarleySets<TI, TD, TP, TSP, TS>, )
src/engine_base.rs:558
↓ 2 callersMethodget_display_form_from_token_ids
( &self, bitset: &fixedbitset_stack::FixedBitSet, )
src/engine_base.rs:573
↓ 2 callersMethodget_start_nonterminal_id
Get the start nonterminal id.
src/grammar.rs:708
↓ 2 callersMethodnonterminals_size
Get the nonterminals size.
src/grammar.rs:853
↓ 2 callersMethodregex_unchecked
Get the regex from the grammar without bounds checking. # Safety The caller must ensure that the regex id is within bounds.
src/grammar.rs:817
↓ 1 callersMethod__repr__
(self)
python/kbnf/engine.py:230
↓ 1 callersMethod__repr__
(&self)
src/ffi_bindings.rs:855
↓ 1 callersFunction_apply_token_bitmask_inplace_triton
( logits: torch.Tensor, bitmask: torch.Tensor, indices: Optional[Union[List[int], torch.Tensor]] =
python/kbnf/triton_logits_mask.py:41
↓ 1 callersFunction_mask_logits_fast
(logits:typing.Any,engine:"Engine")
python/kbnf/engine.py:100
↓ 1 callersFunction_try_register_fast_mask_logits
(module_name:str, fast_mask_logits:typing.Callable[[types.ModuleType],
python/kbnf/engine.py:21
↓ 1 callersMethodadd_tokens_from_eager_regex_cache
( &mut self, skipped_items_indices: &mut Vec<(usize, *const FixedBitSet)>, all_regex:
src/engine_base.rs:1445
↓ 1 callersMethodallowed_token_ids_from_last_computation
(&self)
src/engine.rs:241
↓ 1 callersMethodas_slice_mut
(&mut self)
src/vocabulary.rs:34
↓ 1 callersFunctionceil_div
(a, b)
python/kbnf/triton_logits_mask.py:46
↓ 1 callersMethodcomplement_first_bytes_from_regex
( &self, regex_id: RegexID<TI>, state_id: StateID, )
src/grammar.rs:865
↓ 1 callersMethodcompute_allowed_token_ids
(&mut self)
src/engine_base.rs:1675
↓ 1 callersFunctionconstruct_kbnf_syntax_grammar
Helper function to construct a simplified grammar from an KBNF grammar string.
src/utils.rs:21
↓ 1 callersMethodfill_torch_bitmask
(self, bitmask_ptr:int)
python/kbnf/engine.py:145
↓ 1 callersFunctionfind_max_dotted_position_from_kbnf_syntax_grammar
Helper function to find the maximum dotted position from an KBNF grammar. This is useful for determining [EngineBase](crate::engine_base::EngineBase)
src/utils.rs:72
↓ 1 callersFunctionfind_max_production_id_from_kbnf_syntax_grammar
Helper function to find the maximum production ID from an KBNF grammar. This is useful for determining [EngineBase](crate::engine_base::EngineBase) an
src/utils.rs:83
↓ 1 callersFunctionfind_max_state_id_from_kbnf_syntax_grammar
Helper function to find the maximum state ID from an KBNF grammar. This is useful for determining [EngineBase](crate::engine_base::EngineBase) and [Gr
src/utils.rs:52
↓ 1 callersMethodfirst_bytes_from_regex
( &self, regex_id: RegexID<TI>, state_id: StateID, )
src/grammar.rs:857
↓ 1 callersMethodfirst_bytes_from_suffix_automaton
(&self, state_id: GeneralSamNodeID)
src/grammar.rs:875
↓ 1 callersMethodget_index_of_allowed_token_ids
(self)
python/kbnf/engine.py:136
↓ 1 callersMethodget_number_of_allowed_token_ids
(self)
python/kbnf/engine.py:133
↓ 1 callersMethodget_number_of_disallowed_token_ids
(self)
python/kbnf/engine.py:130
↓ 1 callersFunctionget_token_id_from_str
(vocab: &Vocabulary, token: &str)
tests/test.rs:67
↓ 1 callersMethodid_to_regexes
Get the regexes from the grammar.
src/grammar.rs:843
↓ 1 callersMethodid_to_suffix_automata
Get the suffix automata from the grammar.
src/grammar.rs:848
↓ 1 callersMethodid_to_terminals
Get the terminals from the grammar.
src/grammar.rs:838
↓ 1 callersMethodinternal_config
Converts the configuration to the internal configuration.
src/config.rs:105
↓ 1 callersMethodmask_logits
(&self, logits: &mut [f32])
src/engine_base.rs:1810
↓ 1 callersFunctionread_rwkv_world_vocab
Read the vocabulary from RWKV-world model series vocabulary file.
benches/profiler.rs:20
↓ 1 callersFunctionread_rwkv_world_vocab
Read the vocabulary from RWKV-world model series vocabulary file.
benches/simple.rs:20
↓ 1 callersMethodreset
(&mut self)
src/engine_base.rs:1894
↓ 1 callersMethodrules
(&self)
src/grammar.rs:886
↓ 1 callersFunctionrun_an_engine
(engine: &mut Engine, iteration: usize, token_id: u32, logits: &mut [f32])
benches/profiler.rs:57
↓ 1 callersMethodshrink_to_fit
(&mut self)
src/engine.rs:195
↓ 1 callersMethodsuffix_automata_unchecked
Get the suffix automata from the grammar without bounds checking. # Safety The caller must ensure that the suffix automata id is within bounds.
src/grammar.rs:804
↓ 1 callersMethodterminal
Get the terminal from the grammar.
src/grammar.rs:822
↓ 1 callersMethodterminal_unchecked
Get the terminal from the grammar without bounds checking. # Safety The caller must ensure that the terminal id is within bounds.
src/grammar.rs:831
↓ 1 callersMethodtoken
Retrieves the token associated with the given token ID. # Arguments `token_id` - The ID of the token to retrieve. # Returns `Some(&Token)` - The t
src/vocabulary.rs:194
↓ 1 callersMethodtry_accept_new_token
( &mut self, token_id: u32, )
src/engine_base.rs:1625
↓ 1 callersMethodupdate_allowed_first_bytes
This function requires the last Earley set has been created and fully predicted.
src/engine_base.rs:742
↓ 1 callersMethodwrite_allowed_token_ids_to_buffer
(self, ptr:int, length:int)
python/kbnf/engine.py:142
↓ 1 callersMethodwrite_disallowed_token_ids_to_buffer
(self, ptr:int, length:int)
python/kbnf/engine.py:139
Method__copy__
(self)
python/kbnf/engine.py:236
Method__copy__
(&self)
src/ffi_bindings.rs:863
Method__deepcopy__
(self, memo)
python/kbnf/engine.py:242
Method__deepcopy__
(&self, _memo: pyo3::Bound<'_, PyDict>)
src/ffi_bindings.rs:866
Method__init__
(self, kbnf_syntax_grammar_str, vocabulary, config=None)
python/kbnf/engine.py:108
Method__str__
(self)
python/kbnf/engine.py:233
Method__str__
(&self)
src/ffi_bindings.rs:859
Function_apply_token_bitmask_inplace_kernel
( logits_ptr, bitmask_ptr, indices_ptr, num_rows, vocab_size, bitmask_size, NUM_SM
python/kbnf/triton_logits_mask.py:12
Function_numpy_slice_converter
(module:types.ModuleType)
python/kbnf/engine.py:80
Function_torch_fast_mask_logits
(module:types.ModuleType)
python/kbnf/engine.py:43
Function_torch_slice_converter
(module:types.ModuleType)
python/kbnf/engine.py:31
Methodaccept_byte
( grammar: &Grammar<TI>, earley_sets: &mut EarleySets<TI, TD, TP, TSP, TS>, to_be_comp
src/engine_base.rs:1378
Methodaccept_bytes
( grammar: &Grammar<TI>, earley_sets: &mut EarleySets<TI, TD, TP, TSP, TS>, to_be_comp
src/engine_base.rs:1504
Methodadd
(self, _rhs: Self)
src/zero.rs:61
Methodadd_assign
(&mut self, _rhs: Self)
src/zero.rs:67
Methodadvance_item
( grammar: &Grammar<TI>, to_be_completed_items: &mut AHashSet<ToBeCompletedItem<TI, TSP>>,
src/engine_base.rs:817
Methodadvance_item_normal_unchecked
# Safety earley_sets must has enough capacity to push one new item.
src/engine_base.rs:860
Methodallowed_token_ids_from_last_computation
(&self)
src/engine_base.rs:1860
Methodallowed_token_ids_from_last_computation_js
(&self)
src/ffi_bindings.rs:359
Methodallowed_token_ids_from_last_computation_py
(&self)
src/ffi_bindings.rs:527
Functionalways_match_regex
()
tests/test.rs:463
Functioncheck_dfa_state_status
( dfa_state: StateID, dfa: &kbnf_regex_automata::dfa::dense::DFA<Vec<u32>>, )
src/utils.rs:91
Methodcheck_id_length
(grammar: &SimplifiedGrammar, value: usize)
src/engine.rs:98
Methodcheck_if_token_is_allowed
(self, token_id:int)
python/kbnf/engine.py:127
Methodcheck_if_token_is_allowed_py
(&self, token_id: u32)
src/ffi_bindings.rs:572
Methodcheck_non_existing_byte_in_range
( token_to_id: &AHashMap<Token, u32>, not_existing_bytes: &mut ByteSet, st
src/vocabulary.rs:150
Methodcheck_vocabulary_utf8_support
(token_to_id: &AHashMap<Token, u32>)
src/vocabulary.rs:148
Methodcompact
Compact the Earley sets by removing the Earley sets that are not reachable from the last Earley set
src/engine_base.rs:1300
Methodcomplete
( grammar: &Grammar<TI>, earley_sets: &mut EarleySets<TI, TD, TP, TSP, TS>, to_be_comp
src/engine_base.rs:1216
Methodcompute_allowed_token_ids
(&mut self)
src/engine.rs:225
next →1–100 of 238, ranked by callers