nip.utils.hugging_face.TokenCounts#

class nip.utils.hugging_face.TokenCounts(prompt: Int[ndarray, 'rollout round'], completion: Int[ndarray, 'rollout round'], total: Int[ndarray, 'rollout round'])[source]#

Dataclass to hold token count information.

Methods Summary

__eq__(other)

Return self==value.

__init__(prompt, completion, total)

__repr__()

Return repr(self).

Attributes

prompt

The number of tokens in the prompt for each rollout, round, and agent.

completion

The number of tokens in the completion for each rollout, round, and agent.

total

The total number of tokens (prompt + completion)

Methods

__eq__(other)#

Return self==value.

__init__(prompt: Int[ndarray, 'rollout round'], completion: Int[ndarray, 'rollout round'], total: Int[ndarray, 'rollout round']) None#
__repr__()#

Return repr(self).