MCPcopy Create free account

hub / github.com/RWKV/rwkv.cpp / functions

Functions91 in github.com/RWKV/rwkv.cpp

↓ 11 callersFunctionrwkv_get_state_len
API function.
rwkv.cpp:171
↓ 10 callersMethodencode
(self, src: str)
python/rwkv_cpp/rwkv_world_tokenizer.py:108
↓ 10 callersFunctionsave_thread_state
(_thread: str)
python/chat_with_bot.py:82
↓ 9 callersMethod_get_data_ptr
(self, tensor: NumpyArrayOrPyTorchTensor)
python/rwkv_cpp/rwkv_cpp_model.py:353
↓ 9 callersMethod_validate_tensor
(self, tensor: NumpyArrayOrPyTorchTensor, name: str, size: int)
python/rwkv_cpp/rwkv_cpp_model.py:330
↓ 8 callersFunctionrwkv_get_logits_len
API function.
rwkv.cpp:182
↓ 7 callersFunctionprocess_tokens
(_tokens: List[int], new_line_logit_bias: float = 0.0)
python/chat_with_bot.py:71
↓ 6 callersMethod_zeros_float32
(self, element_count: int, use_numpy: bool)
python/rwkv_cpp/rwkv_cpp_model.py:359
↓ 6 callersFunctionload_thread_state
(_thread: str)
python/chat_with_bot.py:89
↓ 5 callersFunctionrwkv_free
API function.
rwkv.cpp:187
↓ 5 callersFunctionrwkv_get_last_error
API function.
rwkv.cpp:229
↓ 4 callersFunctionadd_tokenizer_argument
(parser)
python/tokenizer_util.py:6
↓ 4 callersFunctionget_tokenizer
(tokenizer_name: str, n_vocab: int)
python/tokenizer_util.py:15
↓ 4 callersFunctionrwkv_init_from_file
API function.
rwkv.cpp:71
↓ 3 callersMethod_detect_numpy_usage
(self, tensors: List[Optional[NumpyArrayOrPyTorchTensor]], use_numpy_by_default: bool)
python/rwkv_cpp/rwkv_cpp_model.py:323
↓ 3 callersMethod_is_pytorch_tensor
(self, tensor: NumpyArrayOrPyTorchTensor)
python/rwkv_cpp/rwkv_cpp_model.py:320
↓ 3 callersMethodeval
Evaluates the model for a single token. In case of any error, this method will throw an exception. Parameters ------
python/rwkv_cpp/rwkv_cpp_model.py:85
↓ 3 callersMethodeval_sequence_in_chunks
Evaluates the model for a sequence of tokens using `eval_sequence`, splitting a potentially long sequence into fixed-length chunks. T
python/rwkv_cpp/rwkv_cpp_model.py:225
↓ 3 callersFunctionrwkv_get_system_info_string
API function.
rwkv.cpp:239
↓ 2 callersMethoddecode
(self, tokens: List[int])
python/rwkv_cpp/rwkv_world_tokenizer.py:111
↓ 2 callersFunctionformat_loss_with_perplexity
(loss: torch.Tensor)
python/measure_pexplexity.py:59
↓ 2 callersMethodfree
Frees all allocated resources. In case of any error, this method will throw an exception. The object must not be used anymore
python/rwkv_cpp/rwkv_cpp_model.py:301
↓ 2 callersMethodrwkv_get_system_info_string
Returns system information string.
python/rwkv_cpp/rwkv_cpp_shared_library.py:368
↓ 2 callersFunctiontest_on_prompt
tests/test_eval_sequence_in_chunks.c:10
↓ 1 callersMethodadd
(self, key: bytes, idx: int = 0, val=None)
python/rwkv_cpp/rwkv_world_tokenizer.py:16
↓ 1 callersMethoddecode_bytes
(self, tokens: List[int])
python/rwkv_cpp/rwkv_world_tokenizer.py:105
↓ 1 callersMethodencode_bytes
(self, src: bytes)
python/rwkv_cpp/rwkv_world_tokenizer.py:92
↓ 1 callersMethodfind_longest
(self, key: bytes, idx: int = 0)
python/rwkv_cpp/rwkv_world_tokenizer.py:32
↓ 1 callersFunctionformat_loss
(loss: torch.Tensor)
python/measure_pexplexity.py:56
↓ 1 callersFunctionget_layer_count
(state_dict: Dict[str, torch.Tensor])
python/convert_pytorch_to_ggml.py:18
↓ 1 callersFunctionmain
()
python/convert_pytorch_to_ggml.py:163
↓ 1 callersFunctionmain
()
python/quantize.py:17
↓ 1 callersFunctionmain
()
python/merge_lora_into_ggml.py:45
↓ 1 callersFunctionparse_args
()
python/measure_pexplexity.py:14
↓ 1 callersFunctionparse_args
()
python/convert_pytorch_to_ggml.py:11
↓ 1 callersFunctionparse_args
()
python/quantize.py:8
↓ 1 callersFunctionparse_args
()
python/merge_lora_into_ggml.py:13
↓ 1 callersFunctionrwkv_clone_context
API function.
rwkv.cpp:123
↓ 1 callersMethodrwkv_eval
Evaluates the model for a single token. Throws an exception in case of any error. Error messages would be printed to stderr.
python/rwkv_cpp/rwkv_cpp_shared_library.py:131
↓ 1 callersMethodrwkv_eval_sequence
Evaluates the model for a sequence of tokens. Uses a faster algorithm than `rwkv_eval` if you do not need the state and logits for ev
python/rwkv_cpp/rwkv_cpp_shared_library.py:167
↓ 1 callersMethodrwkv_eval_sequence_in_chunks
Evaluates the model for a sequence of tokens using `rwkv_eval_sequence`, splitting a potentially long sequence into fixed-length chunks.
python/rwkv_cpp/rwkv_cpp_shared_library.py:216
↓ 1 callersMethodrwkv_free
Frees all allocated memory and the context. Parameters ---------- ctx : RWKVContext RWKV context obtaine
python/rwkv_cpp/rwkv_cpp_shared_library.py:329
↓ 1 callersMethodrwkv_get_logits_buffer_element_count
Returns count of FP32 elements in logits buffer. Parameters ---------- ctx : RWKVContext RWKV context ob
python/rwkv_cpp/rwkv_cpp_shared_library.py:317
↓ 1 callersMethodrwkv_get_n_embed
Returns the number of elements in the given model's embedding. Useful for reading individual fields of a model's hidden state.
python/rwkv_cpp/rwkv_cpp_shared_library.py:277
↓ 1 callersMethodrwkv_get_n_layer
Returns the number of layers in the given model. A layer is a pair of RWKV and FFN operations, stacked multiple times throughout the
python/rwkv_cpp/rwkv_cpp_shared_library.py:290
↓ 1 callersMethodrwkv_get_n_vocab
Returns the number of tokens in the given model's vocabulary. Useful for telling 20B_tokenizer models (n_vocab = 50277) apart from Wo
python/rwkv_cpp/rwkv_cpp_shared_library.py:264
↓ 1 callersMethodrwkv_get_state_buffer_element_count
Returns count of FP32 elements in state buffer. Parameters ---------- ctx : RWKVContext RWKV context obt
python/rwkv_cpp/rwkv_cpp_shared_library.py:305
↓ 1 callersMethodrwkv_init_from_file
Loads the model from a file and prepares it for inference. Throws an exception in case of any error. Error messages would be printed
python/rwkv_cpp/rwkv_cpp_shared_library.py:111
↓ 1 callersMethodrwkv_quantize_model_file
Quantizes FP32 or FP16 model to one of INT4 formats. Throws an exception in case of any error. Error messages would be printed to std
python/rwkv_cpp/rwkv_cpp_shared_library.py:343
↓ 1 callersFunctionrwkv_set_print_errors
API function.
rwkv.cpp:218
↓ 1 callersFunctionsample_probs
(probs: np.ndarray, temperature: float = 1.0, top_p: float = 0.8, logit_bias: Dict[int, float] = None)
python/sampling.py:18
↓ 1 callersFunctionsoftmax
(x: np.ndarray, axis: int)
python/sampling.py:5
↓ 1 callersFunctionsplit_last_end_of_line
(tokens: List[int])
python/chat_with_bot.py:100
↓ 1 callersFunctiontest
()
python/convert_pytorch_to_ggml.test.py:7
↓ 1 callersFunctiontest
()
python/rwkv_cpp/rwkv_world_tokenizer.test.py:4
↓ 1 callersFunctiontest_computation_on_tensors_from_different_contexts
RWKV model loading code depends on this behavior.
tests/test_ggml_basics.c:61
↓ 1 callersFunctiontest_sequential_mode
tests/test_logit_calculation_skipping.c:54
↓ 1 callersFunctiontest_serial_mode
tests/test_logit_calculation_skipping.c:14
↓ 1 callersFunctiontest_simple_computation
tests/test_ggml_basics.c:14
↓ 1 callersFunctiontype_from_string
extras/quantize.c:25
↓ 1 callersFunctionwrite_parameter
(out_file, key: str, parameter: torch.Tensor)
python/merge_lora_into_ggml.py:22
↓ 1 callersFunctionwrite_state_dict
(state_dict: Dict[str, torch.Tensor], dest_path: str, data_type: str)
python/convert_pytorch_to_ggml.py:28
Method__del__
(self)
python/rwkv_cpp/rwkv_cpp_model.py:315
Method__init__
(self, front=None, ch=None)
python/rwkv_cpp/rwkv_world_tokenizer.py:10
Method__init__
(self, file_path)
python/rwkv_cpp/rwkv_world_tokenizer.py:68
Method__init__
Loads the model and prepares it for inference. In case of any error, this method will throw an exception. Parameters
python/rwkv_cpp/rwkv_cpp_model.py:27
Method__init__
(self, ptr: ctypes.pointer)
python/rwkv_cpp/rwkv_cpp_shared_library.py:23
Method__init__
Loads the shared library from specified file. In case of any error, this method will throw an exception. Parameters
python/rwkv_cpp/rwkv_cpp_shared_library.py:31
Method__repr__
(self)
python/rwkv_cpp/rwkv_world_tokenizer.py:54
Methodeval_sequence
Evaluates the model for a sequence of tokens. NOTE ON GGML NODE LIMIT ggml has a hard-coded limit on max amount of nodes in
python/rwkv_cpp/rwkv_cpp_model.py:150
Functionget_world_tokenizer_v20230424
Loads the default World tokenizer, commonly used in RWKV v4 World models. Returns a tuple of `decode` and `encode` functions.
python/rwkv_cpp/rwkv_world_tokenizer.py:116
Functionload_rwkv_shared_library
Attempts to find rwkv.cpp shared library and load it. To specify exact path to the library, create an instance of RWKVSharedLibrary explicitl
python/rwkv_cpp/rwkv_cpp_shared_library.py:375
Functionmain
tests/test_quantized_matmul_on_gpu.c:26
Functionmain
tests/test_quantization_format_compatibility.c:11
Functionmain
tests/test_eval_sequence_in_chunks.c:68
Functionmain
tests/test_ggml_basics.c:102
Functionmain
tests/test_tiny_rwkv.c:12
Functionmain
tests/test_context_cloning.c:10
Functionmain
tests/test_logit_calculation_skipping.c:92
Functionmain
extras/quantize.c:36
Functionmain
extras/cpu_info.c:5
Methodn_embed
(self)
python/rwkv_cpp/rwkv_cpp_model.py:78
Methodn_layer
(self)
python/rwkv_cpp/rwkv_cpp_model.py:82
Methodn_vocab
(self)
python/rwkv_cpp/rwkv_cpp_model.py:74
Functionrwkv_get_logits_buffer_element_count
rwkv.cpp:151
Functionrwkv_get_n_embed
API function.
rwkv.cpp:161
Functionrwkv_get_n_layer
API function.
rwkv.cpp:166
Functionrwkv_get_n_vocab
API function.
rwkv.cpp:156
Functionrwkv_get_print_errors
API function.
rwkv.cpp:224
Functionrwkv_get_state_buffer_element_count
rwkv.cpp:145
Functionsample_logits
(out, temperature: float = 1.0, top_p: float = 0.8, logit_bias: Dict[int, float] = None)
python/sampling.py:10