nip.utils.hugging_face

nip.utils.hugging_face#

Utility functions for Hugging Face libraries.

Functions

count_tokens(rollouts, agent_id, model_name)

Count the number of tokens in the rollouts.

is_model_peft(model_name)

Check if a model is a PEFT model by looking for the PEFT config file.

Classes

TokenCounts(prompt, completion, total)

Dataclass to hold token count information.