modalities.utils.profilers package

Submodules

modalities.utils.profilers.batch_generator module

class modalities.utils.profilers.batch_generator.DatasetBatchGeneratorIF[source]

Bases: ABC

get_dataset_batch()[source]
Return type:

DatasetBatch

class modalities.utils.profilers.batch_generator.RandomDatasetBatchGenerator(vocab_size, sequence_length, batch_size)[source]

Bases: DatasetBatchGeneratorIF

Parameters:
  • vocab_size (int)

  • sequence_length (int)

  • batch_size (int)

get_dataset_batch()[source]
Return type:

DatasetBatch

class modalities.utils.profilers.batch_generator.RandomDatasetBatchGeneratorConfig(**data)[source]

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
  • vocab_size (int)

  • sequence_length (int)

  • batch_size (int)

batch_size: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

sequence_length: int
vocab_size: int

Module contents