opensi·si

Model configuration classes in 🤗 Transformers are not standardized. Although Transformers implements an attributemap attribute that mitigates the issue to some extent, it does…

Normalized configurations

Model configuration classes in 🤗 Transformers are not standardized. Although Transformers implements an attribute_map attribute that mitigates the issue to some extent, it does not make it easy to reason on common configuration attributes in the code. optimum.utils.normalized_config.NormalizedConfig classes try to fix that by allowing access to the configuration attribute they wrap in a standardized way.

Base class

While it is possible to create NormalizedConfig subclasses for common use-cases, it is also possible to overwrite the original attribute name -> normalized attribute name mapping directly using the optimum.utils.normalized_config.NormalizedConfig.with_args class method.

[[autodoc]] optimum.utils.normalized_config.NormalizedConfig

Existing normalized configurations

[[autodoc]] optimum.utils.normalized_config.NormalizedTextConfig

[[autodoc]] optimum.utils.normalized_config.NormalizedSeq2SeqConfig

[[autodoc]] optimum.utils.normalized_config.NormalizedVisionConfig

[[autodoc]] optimum.utils.normalized_config.NormalizedTextAndVisionConfig

Source and license

Source: Optimum documentation, adapted for this site. Licensing and attribution follow the terms of the upstream project.