code: def test_save_to_state_dict_adapter(
      self, encoder_config: LLMEncoderConfig, adapter: str, tmpdir
  ):
      # With an adapter, the state dict should only contain adapter parameters
      encoder_config_with_adapter = (
          self.create_encoder_config_with_adapter(
              encoder_config, adapter
          )
      )
      encoder = LLMEncoder(encoder_config=encoder_config_with_adapter)
      # Initialize the adapters
      encoder.prepare_for_training()
      assert all(
          map(lambda k: "lora_" in k, encoder.state_dict().keys())
      )
  
imports: import copy
  import pytest
  import torch
  import torch.nn
  from transformers import AutoConfig, PreTrainedModel
  from ludwig.encoders.text_encoders import LLMEncoder
  from ludwig.schema.encoders.text_encoders import LLMEncoderConfig
  from ludwig.schema.llms.peft import BaseAdapterConfig, LoraConfig
  from ludwig.utils.llm_utils import get_context_len
label_desc: Use image node_id 6 for calling the TestLLMEncoder obj's underlying member method code with example usage: obj.test_save_to_state_dict_adapter(encoder_config, adapter, tmpdir) without return types