# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # This file was automatically generated from src/transformers/models/cosmos3_omni/modular_cosmos3_omni.py. # Do NOT edit this file manually as any edits will be overwritten by the generation of # the file from the modular. If any change should be done, please apply the change to the # modular_cosmos3_omni.py file directly. One of our CI enforces this. # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 # Copyright 2026 NVIDIA Corporation and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from huggingface_hub.dataclasses import strict from ...configuration_utils import PreTrainedConfig from ...utils import auto_docstring from ..auto import CONFIG_MAPPING, AutoConfig @auto_docstring(checkpoint="nvidia/Cosmos3-Nano") @strict class Cosmos3OmniConfig(PreTrainedConfig): r""" Example: ```python >>> from transformers import Cosmos3OmniForConditionalGeneration, Cosmos3OmniConfig >>> # Initializing a Cosmos3 style configuration >>> configuration = Cosmos3OmniConfig() >>> # Initializing a model from the Cosmos3 style configuration >>> model = Cosmos3OmniForConditionalGeneration(configuration) >>> # Accessing the model configuration >>> configuration = model.config ```""" model_type = "cosmos3_omni" sub_configs = {"vision_config": AutoConfig, "text_config": AutoConfig} keys_to_ignore_at_inference = ["past_key_values"] text_config: dict | PreTrainedConfig | None = None vision_config: dict | PreTrainedConfig | None = None image_token_id: int = 151655 video_token_id: int = 151656 vision_start_token_id: int = 151652 vision_end_token_id: int = 151653 tie_word_embeddings: bool = False def __post_init__(self, **kwargs): if isinstance(self.vision_config, dict): model_type = self.vision_config.pop("model_type", "qwen3_vl_vision") if model_type == "qwen3_vl": model_type = "qwen3_vl_vision" self.vision_config = CONFIG_MAPPING[model_type](**self.vision_config) elif self.vision_config is None: self.vision_config = CONFIG_MAPPING["qwen3_vl_vision"]() if isinstance(self.text_config, dict): model_type = self.text_config.get("model_type", "qwen3_vl_text") self.text_config = CONFIG_MAPPING[model_type](**self.text_config) elif self.text_config is None: self.text_config = CONFIG_MAPPING["qwen3_vl_text"]() super().__post_init__(**kwargs) __all__ = ["Cosmos3OmniConfig"]