code: def test_generation_8k(self):
      model_id = "mosaicml/mpt-7b-8k"
      tokenizer = AutoTokenizer.from_pretrained(model_id)
  
      # 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,
      )
  
      input_text = "Hello"
      expected_output = 'Hello, I\'m a new user of the forum. I have a question about the "Safety"'
  
      inputs = tokenizer(input_text, return_tensors="pt")
      outputs = model.generate(**inputs, max_new_tokens=20)
  
      decoded_output = tokenizer.decode(
          outputs[0], skip_special_tokens=True
      )
      self.assertEqual(decoded_output, expected_output)
  
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 1 for calling the MptIntegrationTests obj's underlying member method code with example usage: obj.test_generation_8k() without return types