MCPcopy Create free account
hub / github.com/RWKV/rwkv.cpp / eval_sequence_in_chunks

Method eval_sequence_in_chunks

python/rwkv_cpp/rwkv_cpp_model.py:225–299  ·  view source on GitHub ↗

Evaluates the model for a sequence of tokens using `eval_sequence`, splitting a potentially long sequence into fixed-length chunks. This function is useful for processing complete prompts and user input in chat & role-playing use-cases. It is recommended to use this function

(
            self,
            tokens: List[int],
            state_in: Optional[NumpyArrayOrPyTorchTensor],
            state_out: Optional[NumpyArrayOrPyTorchTensor] = None,
            logits_out: Optional[NumpyArrayOrPyTorchTensor] = None,
            chunk_size: int = 16,
            use_numpy: bool = False
    )

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 3

process_tokensFunction · 0.80

Calls 5

_detect_numpy_usageMethod · 0.95
_validate_tensorMethod · 0.95
_get_data_ptrMethod · 0.95
_zeros_float32Method · 0.95

Tested by

no test coverage detected