code: def test_model_logits(self):
      model_id = "mosaicml/mpt-7b"
  
      # Load in 4bit to fit the daily CI runner GPU RAM
      model = MptForCausalLM.from_pretrained(
          model_id,
          torch_dtype=torch.bfloat16,
          device_map={"": 0},
          load_in_4bit=True,
      )
  
      dummy_input = torch.LongTensor([[1, 2, 3, 4, 5]]).to(torch_device)
  
      outputs = model(dummy_input, output_hidden_states=True)
  
      expected_slice = torch.Tensor([-0.2539, -0.2178, -0.1953]).to(
          torch_device, torch.bfloat16
      )
      predicted_slice = outputs.hidden_states[-1][0, 0, :3]
  
      self.assertTrue(
          torch.allclose(
              expected_slice, predicted_slice, atol=1e-3, rtol=1e-3
          )
      )
  
imports: import math
  import unittest
  from transformers import MptConfig, is_torch_available
  from transformers.testing_utils import require_bitsandbytes, require_torch, require_torch_gpu, slow, torch_device
  from ...generation.test_utils import GenerationTesterMixin
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
  from ...test_pipeline_mixin import PipelineTesterMixin
label_desc: Use image node_id 4 for calling the MptIntegrationTests obj's underlying member method code with example usage: obj.test_model_logits() without return types