( config: PretrainedConfig task: str batch_size: int = 1 sequence_length: typing.Optional[int] = None num_choices: typing.Optional[int] = None width: typing.Optional[int] = None height: typing.Optional[int] = None num_channels: typing.Optional[int] = None feature_size: typing.Optional[int] = None nb_max_frames: typing.Optional[int] = None audio_sequence_length: typing.Optional[int] = None )
Parameters
transformers.PretrainedConfig
) —
The model configuration.
str
, defaults to "default"
) —
The task the model should be exported for.
TFLiteConfig
is designed for. —
Base class for TFLite exportable model describing metadata on how to export the model through the TFLite format.
Class attributes:
NORMALIZED_CONFIG_CLASS (Type
) — A class derived from NormalizedConfig specifying how to
normalize the model config.
DUMMY_INPUT_GENERATOR_CLASSES (Tuple[Type]
) — A tuple of classes derived from
DummyInputGenerator specifying how to create dummy inputs.
ATOL_FOR_VALIDATION (Union[float, Dict[str, float]]
) — A float or a dictionary mapping task names to float,
where the float values represent the absolute tolerance value to use during model conversion validation.
MANDATORY_AXES (Tuple[Union[str, Tuple[Union[str, Tuple[str]]]]]
) — A tuple where each element is either:
For example: MANDATORY_AXES = ("batch_size", "sequence_length", ("multiple-choice", "num_choices"))
means that
to export the model, the batch size and sequence length values always need to be specified, and that a value
for the number of possible choices is needed when the task is multiple-choice.
List containing the names of the inputs the exported model should take.
List containing the names of the outputs the exported model should have.
(
)
→
Dict[str, tf.Tensor]
Returns
Dict[str, tf.Tensor]
A dictionary mapping input names to dummy tensors.
Generates dummy inputs that the exported model should be able to process. This method is actually used to determine the input specs that are needed for the export.
( config: PretrainedConfig task: str batch_size: int = 1 sequence_length: typing.Optional[int] = None num_choices: typing.Optional[int] = None width: typing.Optional[int] = None height: typing.Optional[int] = None num_channels: typing.Optional[int] = None feature_size: typing.Optional[int] = None nb_max_frames: typing.Optional[int] = None audio_sequence_length: typing.Optional[int] = None )
Handles encoder-based text architectures.
( config: PretrainedConfig task: str batch_size: int = 1 sequence_length: typing.Optional[int] = None num_choices: typing.Optional[int] = None width: typing.Optional[int] = None height: typing.Optional[int] = None num_channels: typing.Optional[int] = None feature_size: typing.Optional[int] = None nb_max_frames: typing.Optional[int] = None audio_sequence_length: typing.Optional[int] = None )
Handles vision architectures.