mstar.model.pi05.components.tokenization

mstar.model.pi05.components.tokenization#

Tokenization wrapper for Pi0.5: PaliGemma tokenizer and openpi’s prompt text.

Functions

pi05_prompt(task[, state_bins])

The text openpi's PaligemmaTokenizer tokenizes for pi0.5.

Classes

Pi05Tokenizer(hf_tokenizer, config)

Wrapper around the HF PaliGemma tokenizer.

class mstar.model.pi05.components.tokenization.Pi05Tokenizer(hf_tokenizer, config)[source]#

Bases: object

Wrapper around the HF PaliGemma tokenizer. The robot state reaches it as text inside the prompt (see pi05_prompt()).

Parameters:

config (Pi05Config)

encode_prompt(prompt)[source]#
Parameters:

prompt (str)

Return type:

Tensor

mstar.model.pi05.components.tokenization.pi05_prompt(task, state_bins=None)[source]#

The text openpi’s PaligemmaTokenizer tokenizes for pi0.5.

Underscores and newlines in the task become spaces. The case is kept, and so is the space after “Action:”, since openpi tokenizes the string as built.

Parameters:
Return type:

str