configuration_mlcd.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
  2. # This file was automatically generated from src/transformers/models/mlcd/modular_mlcd.py.
  3. # Do NOT edit this file manually as any edits will be overwritten by the generation of
  4. # the file from the modular. If any change should be done, please apply the change to the
  5. # modular_mlcd.py file directly. One of our CI enforces this.
  6. # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
  7. # Copyright 2025 The HuggingFace Inc. team.
  8. #
  9. # Licensed under the Apache License, Version 2.0 (the "License");
  10. # you may not use this file except in compliance with the License.
  11. # You may obtain a copy of the License at
  12. #
  13. # http://www.apache.org/licenses/LICENSE-2.0
  14. #
  15. # Unless required by applicable law or agreed to in writing, software
  16. # distributed under the License is distributed on an "AS IS" BASIS,
  17. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18. # See the License for the specific language governing permissions and
  19. # limitations under the License.
  20. from huggingface_hub.dataclasses import strict
  21. from ...configuration_utils import PreTrainedConfig
  22. from ...utils import auto_docstring
  23. @auto_docstring(checkpoint="DeepGlint-AI/mlcd-vit-bigG-patch14-336")
  24. @strict
  25. class MLCDVisionConfig(PreTrainedConfig):
  26. r"""
  27. num_key_value_groups (`int`, *optional*, defaults to 1):
  28. Number of key-value groups used in Attention.
  29. Example:
  30. ```python
  31. >>> from transformers import MLCDVisionConfig, MLCDVisionModel
  32. >>> # Initializing a MLCDVisionConfig with DeepGlint-AI/mlcd-vit-bigG-patch14-336 style configuration
  33. >>> configuration = MLCDVisionConfig()
  34. >>> # Initializing a MLCDVisionModel (with random weights) from the DeepGlint-AI/mlcd-vit-bigG-patch14-336 style configuration
  35. >>> model = MLCDVisionModel(configuration)
  36. >>> # Accessing the model configuration
  37. >>> configuration = model.config
  38. ```"""
  39. model_type = "mlcd_vision_model"
  40. base_config_key = "vision_config"
  41. hidden_size: int = 1664
  42. intermediate_size: int = 8192
  43. num_hidden_layers: int = 48
  44. num_attention_heads: int = 16
  45. num_key_value_groups: int = 1
  46. num_channels: int = 3
  47. image_size: int | list[int] | tuple[int, int] = 336
  48. patch_size: int | list[int] | tuple[int, int] = 14
  49. hidden_act: str = "gelu"
  50. layer_norm_eps: float = 1e-5
  51. attention_dropout: float | int = 0.0
  52. initializer_range: float = 0.02
  53. initializer_factor: float = 1.0
  54. __all__ = ["MLCDVisionConfig"]