def __init__()

in ultravox/model/ultravox_model.py [0:0]


    def __init__(self, config: UltravoxConfig):
        super().__init__(config)
        self._register_load_state_dict_pre_hook(self._pre_load_state_dict_hook)

        self.keep_params: Set[str] = set()
        self.vocab_size = config.vocab_size

        self.audio_tower = self._create_audio_tower(config)
        self.audio_tower_context_length: Optional[int] = None
        self.audio_tower_context_length = self.audio_tower.max_context_length

        self.multi_modal_projector = self._create_multi_modal_projector(config)
        self.language_model = self._create_language_model(config)

        # Determine no_split_modules dynamically to use with FSDP auto_wrap policy.
        # FSDP throws an error if some of the layer types are not found in the model.
        # This would be something like ["LlamaDecoderLayer"] as we don't split audio encoder layers.
        self._no_split_modules = self.language_model._no_split_modules

        self.loss_config = LossConfig()
        self.post_init()