code: def test_init(self, encoder_config: LLMEncoderConfig, model_config):
      # Test initializing without an adapter
      encoder = LLMEncoder(encoder_config=encoder_config)
  
      assert encoder.model_name == encoder_config.base_model
      assert isinstance(encoder.model, PreTrainedModel)
      assert all(
          map(lambda k: "lora_" not in k, encoder.state_dict().keys())
      )  # Check adapter was not initialized
      assert encoder.input_shape == torch.Size(
          [encoder_config.max_sequence_length]
      )
      assert encoder.output_shape == torch.Size(
          [encoder_config.max_sequence_length, model_config.hidden_size]
      )
  
      # Test that max sequence length falls back to the context length when too large
      context_len = get_context_len(model_config)
      cl_config = copy.deepcopy(encoder_config)
      cl_config.max_sequence_length = context_len + 1
  
      encoder = LLMEncoder(encoder_config=cl_config)
  
      assert encoder.model_name == encoder_config.base_model
      assert isinstance(encoder.model, PreTrainedModel)
      assert all(
          map(lambda k: "lora_" not in k, encoder.state_dict().keys())
      )  # Check adapter was not initialized
      assert encoder.input_shape == torch.Size([context_len])
      assert encoder.output_shape == torch.Size(
          [context_len, model_config.hidden_size]
      )
  
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 2 for calling the TestLLMEncoder obj's underlying member method code with example usage: obj.test_init(encoder_config, model_config) without return types