onnx_diagnostic.tasks.zero_shot_image_classification

onnx_diagnostic.tasks.zero_shot_image_classification.get_inputs(model: Module, config: Any | None, dummy_max_token_id: int, batch_size: int = 2, sequence_length: int = 30, input_width: int = 224, input_height: int = 224, input_channels: int = 3, batch_size_image=3, **kwargs)[source]

Generates inputs for task zero-short-image-classification.

Parameters:
  • model – model to get the missing information

  • config – configuration used to generate the model

  • dummy_max_token_id – vocabulary size

  • batch_size – batch size

  • sequence_length – sequence length

  • batch_size_image – number of images

  • input_channels – input channel

  • input_width – input width

  • input_height – input height

Returns:

dictionary

# input_ids:T7s2x7 # attention_mask:T7s2x7 # pixel_values:T1s2x3x224x224

onnx_diagnostic.tasks.zero_shot_image_classification.random_input_kwargs(config: Any, task: str) Tuple[Dict[str, Any], Callable][source]

Inputs kwargs.

If the configuration is None, the function selects typical dimensions.

onnx_diagnostic.tasks.zero_shot_image_classification.reduce_model_config(config: Any, task: str) Dict[str, Any][source]

Reduces a model size.