ModelInput - Tinker Documentation

tinker.types.ModelInput

class tinker.types.ModelInput( StrictBase)

Fields:

[**from

tokens**](https://github.com/thinking-machines-lab/tinker/blob/main/src/tinker/types/_pydantic_types/model_input.py#L13)( tokens)

Create a ModelInput from a list of ints (tokens).

Parameters:

Returns: ModelInput

[**to

tokens**](https://github.com/thinking-machines-lab/tinker/blob/main/src/tinker/types/_pydantic_types/model_input.py#L19)()

Convert the ModelInput to a list of ints (tokens) Throws exception if there are any non-token chunks

Returns: List[int]

property length

Return the total context length used by this ModelInput.

Returns: int

empty()

Create an empty ModelInput.

Returns: ModelInput

append( chunk)

Add a new chunk, return a new ModelInput.

Parameters:

Returns: ModelInput

[**append

token**](https://github.com/thinking-machines-lab/tinker/blob/main/src/tinker/types/_pydantic_types/model_input.py#L50)( token)

Add a new token, return a new ModelInput.

Parameters:

Returns: ModelInput

Referenced by