Detect if the model with this config is used as an encoder/decoder.
(config: PretrainedConfig)
| 230 | |
| 231 | |
| 232 | def is_encoder_decoder(config: PretrainedConfig) -> bool: |
| 233 | """Detect if the model with this config is used as an encoder/decoder.""" |
| 234 | text_config = getattr(config, "text_config", None) |
| 235 | if text_config is not None: |
| 236 | return is_encoder_decoder(text_config) |
| 237 | |
| 238 | return getattr(config, "is_encoder_decoder", False) |
| 239 | |
| 240 | |
| 241 | def get_config( |
nothing calls this directly
no outgoing calls
no test coverage detected