docstr: Test if the max_input_length works with exllama + act_order
docstr_tok: ["Test","if","the","max_input_length","works","with","exllama","+","act_order"]
code: def test_exllama_max_input_length(self):
      """
      Test if the max_input_length works with exllama + act_order
      """
      from accelerate import init_empty_weights
  
      with tempfile.TemporaryDirectory() as tmpdirname:
          self.quantizer.save(self.quantized_model, tmpdirname)
          self.quantized_model.config.save_pretrained(tmpdirname)
          with init_empty_weights():
              empty_model = AutoModelForCausalLM.from_config(
                  AutoConfig.from_pretrained(self.model_name),
                  torch_dtype=torch.float16,
              )
          empty_model.tie_weights()
          quantized_model_from_saved = load_quantized_model(
              empty_model,
              save_folder=tmpdirname,
              device_map={"": 0},
              max_input_length=4028,
              exllama_config={"version": 1},
          )
          self.check_quantized_layers_type(
              quantized_model_from_saved, "exllama"
          )
  
          prompt = "I am in Paris and" * 1000
          inp = self.tokenizer(prompt, return_tensors="pt").to(0)
          self.assertTrue(inp["input_ids"].shape[1] > 4028)
          with self.assertRaises(RuntimeError) as cm:
              quantized_model_from_saved.generate(
                  **inp, num_beams=1, min_new_tokens=3, max_new_tokens=3
              )
              self.assertTrue(
                  "temp_state buffer is too small" in str(cm.exception)
              )
  
          prompt = "I am in Paris and" * 500
          inp = self.tokenizer(prompt, return_tensors="pt").to(0)
          self.assertTrue(inp["input_ids"].shape[1] < 4028)
          quantized_model_from_saved.generate(
              **inp, num_beams=1, min_new_tokens=3, max_new_tokens=3
          )
  
imports: import tempfile
  import unittest
  import torch
  from parameterized import parameterized
  from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
  from transformers.testing_utils import slow
  from optimum.gptq import GPTQQuantizer, load_quantized_model
  from optimum.gptq.data import get_dataset
  from optimum.utils.import_utils import is_auto_gptq_available
  from optimum.utils.testing_utils import require_accelerate, require_auto_gptq, require_torch_gpu
label_desc: Use image node_id 4 for calling the GPTQTestActOrder obj's underlying member method code with example usage: obj.test_exllama_max_input_length() without return types