# coding=utf-8 # Copyright 2024 NAVER Cloud Corp. 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. """MambaMia video-audio compressor configuration""" from transformers import AutoConfig from transformers.configuration_utils import PretrainedConfig class MambaMiaVideoAudioCompressorConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of a MambaMia video-audio compressor. Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the documentation from [`PretrainedConfig`] for more information. Args: input_size (`int`, *optional*, defaults to 1280): Input embedding dimension (e.g., 1280 for Whisper encoder output). output_size (`int`, *optional*, defaults to 2048): Output embedding dimension (e.g., 2048 for LLM hidden size). chunk_size (`int`, *optional*, defaults to 25): Number of tokens per chunk (i.e., 1 second at 25Hz). num_hidden_layers (`int`, *optional*, defaults to 1): Number of MambaMia2 layers. hidden_size (`int`, *optional*, defaults to 3072): Internal hidden size. Must be divisible by 24. """ model_type = "mambamia_videoaudio_compressor" def __init__( self, input_size: int = 1280, output_size: int = 2048, chunk_size: int = 25, num_hidden_layers: int = 1, hidden_size: int = 3072, **kwargs, ): super().__init__(**kwargs) self.input_size = input_size self.output_size = output_size self.chunk_size = chunk_size self.num_hidden_layers = num_hidden_layers self.hidden_size = hidden_size AutoConfig.register("mambamia_videoaudio_compressor", MambaMiaVideoAudioCompressorConfig) __all__ = ["MambaMiaVideoAudioCompressorConfig"]