docstr: PretrainedConfigurations should not raise an Exception when serializing the config dict
  
  See, e.g., PretrainedConfig.to_json_string()
docstr_tok: ["PretrainedConfigurations","should","not","raise","an","Exception","when","serializing","the","config","dict","See",",","e.g.",",","PretrainedConfig.to_json_string","(",")"]
code: def test_model_config_serialization(self):
      """PretrainedConfigurations should not raise an Exception when serializing the config dict
  
      See, e.g., PretrainedConfig.to_json_string()
      """
      for k, v in ADAPTER_CONFIG_MAP.items():
          model = self.get_model()
          # HACK: reduce the reduction factor such that
          # the small test model can have a phm_dim of 4
          if hasattr(v, "phm_layer") and v.phm_layer:
              v = v.__class__(reduction_factor=4)
          model.add_adapter("test", config=v)
          # should not raise an exception
          model.config.to_json_string()
  
imports: import copy
  import tempfile
  import torch
  import adapters
  from adapters import ADAPTER_CONFIG_MAP, ADAPTER_MODEL_MAPPING, AutoAdapterModel, BatchSplit, DoubleSeqBnConfig, DoubleSeqBnInvConfig, Fuse, InvertibleAdaptersMixin, InvertibleAdaptersWrapperMixin, MAMConfig, SeqBnConfig, SeqBnInvConfig
  from adapters.heads.language_modeling import CausalLMHead
  from transformers import MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING, CLIPConfig
  from transformers.testing_utils import require_torch, torch_device
  from .base import AdapterMethodBaseTestMixin, create_twin_models
label_desc: Use image node_id 15 for calling the BottleneckAdapterTestMixin obj's underlying member method code with example usage: obj.test_model_config_serialization() without return types