MultiModalFieldConfig(field: vllm.multimodal.inputs.BaseMultiModalField, modality: str)
Summary
Functions
Defines a field where an element in the batch is obtained by
Python method MultiModalFieldConfig.build_elems.
Defines a field where an element in the batch is obtained by
Defines a field where an element in the batch is obtained by
Initialize self. See help(type(self)) for accurate signature.
Defines a field where an element in the batch is obtained by
Types
Functions
@spec batched(SnakeBridge.Ref.t(), String.t(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Defines a field where an element in the batch is obtained by
indexing into the first dimension of the underlying data.
Parameters
modality- The modality of the multi-modal item that uses this keyword argument.keep_on_cpu- Whether to keep this field on the CPU for the model inputs.
Returns
term()
@spec build_elems( SnakeBridge.Ref.t(), String.t(), (([(([term()] | [term()]) | term()) | {term(), term()}] | [term()]) | term()) | {term(), term()}, keyword() ) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Python method MultiModalFieldConfig.build_elems.
Parameters
key(String.t())batch(((list(((list(term()) | list(term())) | term()) | {term(), term()}) | list(term())) | term()) | {term(), term()})
Returns
term()
@spec flat(SnakeBridge.Ref.t(), String.t(), term(), [term()], keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Defines a field where an element in the batch is obtained by
slicing along the first dimension of the underlying data.
Parameters
modality- The modality of the multi-modal item that uses this keyword argument.slices- For each multi-modal item, a slice (dim=0) or a tuple of slices (dim>0) that is used to extract the data corresponding to it.dim- The dimension to extract data, default to 0.keep_on_cpu- Whether to keep this field on the CPU for the model inputs.
Returns
term()
@spec flat_from_sizes(SnakeBridge.Ref.t(), String.t(), term(), [term()], keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
Defines a field where an element in the batch is obtained by
slicing along the first dimension of the underlying data.
Parameters
modality- The modality of the multi-modal item that uses this keyword argument.size_per_item- For each multi-modal item, the size of the slice that is used to extract the data corresponding to it.dim- The dimension to slice, default to 0.keep_on_cpu- Whether to keep this field on the CPU for the model inputs.
Returns
term()
@spec new(term(), String.t(), keyword()) :: {:ok, SnakeBridge.Ref.t()} | {:error, Snakepit.Error.t()}
Initialize self. See help(type(self)) for accurate signature.
Parameters
field(term())modality(String.t())