r""" This is the configuration class to store the configuration of a [`FunAudioChatForConditionalGeneration`]. It is used to instantiate an Qwen2-Audio model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield
| 155 | self.pad_token_id = pad_token_id |
| 156 | |
| 157 | class FunAudioChatConfig(PretrainedConfig): |
| 158 | r""" |
| 159 | This is the configuration class to store the configuration of a [`FunAudioChatForConditionalGeneration`]. It is used to instantiate an |
| 160 | Qwen2-Audio model according to the specified arguments, defining the model architecture. Instantiating a configuration |
| 161 | with the defaults will yield a similar configuration to that of the Qwen2-Audio. |
| 162 | |
| 163 | e.g. [FunAudioLLM/Fun-Audio-Chat-8B](https://huggingface.co/FunAudioLLM/Fun-Audio-Chat-8B) |
| 164 | |
| 165 | Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the |
| 166 | documentation from [`PretrainedConfig`] for more information. |
| 167 | |
| 168 | Args: |
| 169 | audio_config (`Union[AutoConfig, dict]`, *optional*, defaults to `CLIPVisionConfig`): |
| 170 | The config object or dictionary of the audio backbone. |
| 171 | text_config (`Union[AutoConfig, dict]`, *optional*, defaults to `LlamaConfig`): |
| 172 | The config object or dictionary of the text backbone. |
| 173 | audio_token_index (`int`, *optional*, defaults to 151646): |
| 174 | The audio token index to encode the audio prompt. |
| 175 | ignore_index (`int`, *optional*, defaults to -100): |
| 176 | The index to ignore in loss calculation. |
| 177 | hidden_size (`int`, *optional*): |
| 178 | Hidden size of the model. If not specified, will use text_config.hidden_size. |
| 179 | |
| 180 | Example: |
| 181 | |
| 182 | ```python |
| 183 | >>> from transformers import FunAudioChatForConditionalGeneration, FunAudioChatConfig, FunAudioChatEncoderConfig, Qwen2Config |
| 184 | |
| 185 | >>> # Initializing a FunAudioChatEncoder config |
| 186 | >>> audio_config = FunAudioChatEncoderConfig() |
| 187 | |
| 188 | >>> # Initializing a Qwen2 config |
| 189 | >>> text_config = Qwen2Config() |
| 190 | |
| 191 | >>> # Initializing a FunAudioChat configuration |
| 192 | >>> configuration = FunAudioChatConfig(audio_config, text_config) |
| 193 | |
| 194 | >>> # Initializing a model from the qwen2-audio style configuration |
| 195 | >>> model = FunAudioChatForConditionalGeneration(configuration) |
| 196 | |
| 197 | >>> # Accessing the model configuration |
| 198 | >>> configuration = model.config |
| 199 | ```""" |
| 200 | |
| 201 | model_type = "funaudiochat" |
| 202 | attribute_map = { |
| 203 | "audio_token_id": "audio_token_index", |
| 204 | } |
| 205 | sub_configs = {"text_config": AutoConfig, "audio_config": AutoConfig} |
| 206 | |
| 207 | def __init__( |
| 208 | self, |
| 209 | audio_config=None, |
| 210 | text_config=None, |
| 211 | audio_token_index=151646, |
| 212 | ignore_index=-100, |
| 213 | hidden_size=None, |
| 214 | **kwargs, |
nothing calls this directly
no outgoing calls
no test coverage detected