docstr: Test the generation quality of the quantized model and see that we are matching the expected output.
  Given that we are operating on small numbers + the testing model is relatively small, we might not get
  the same output across GPUs. So we'll generate few tokens (5-10) and check their output.
docstr_tok: ["Test","the","generation","quality","of","the","quantized","model","and","see","that","we","are","matching","the","expected","output",".","Given","that","we","are","operating","on","small","numbers","+","the","testing","model","is","relatively","small",",","we","might","not","get","the","same","output","across","GPUs",".","So","we","'ll","generate","few","tokens","(","5-10",")","and","check","their","output","."]
code: def test_generate_quality(self):
      r"""
      Test the generation quality of the quantized model and see that we are matching the expected output.
      Given that we are operating on small numbers + the testing model is relatively small, we might not get
      the same output across GPUs. So we'll generate few tokens (5-10) and check their output.
      """
      encoded_input = self.tokenizer(
          self.input_text, return_tensors="pt"
      )
      output_sequences = self.model_4bit.generate(
          input_ids=encoded_input["input_ids"].to(0), max_new_tokens=10
      )
  
      self.assertIn(
          self.tokenizer.decode(
              output_sequences[0], skip_special_tokens=True
          ),
          self.EXPECTED_OUTPUTS,
      )
  
imports: import gc
  import importlib.metadata
  import tempfile
  import unittest
  from packaging import version
  from transformers import AutoConfig, AutoModel, AutoModelForCausalLM, AutoModelForSeq2SeqLM, AutoModelForSequenceClassification, AutoTokenizer, BitsAndBytesConfig, pipeline
  from transformers.testing_utils import is_bitsandbytes_available, is_torch_available, require_accelerate, require_bitsandbytes, require_torch, require_torch_gpu, require_torch_multi_gpu, slow, torch_device
label_desc: Use image node_id 9 for calling the Bnb4BitTest obj's underlying member method code with example usage: obj.test_generate_quality() without return types