AttributeError 'LlamaLikeModel' object has no attribute 'layers'

#1
by jeffrey-sh - opened

@TheBloke Hello.
I ran the code and the set quant_path to TheBloke/Llama-2-13B-AWQ. However, I encountered the following error. How I resolve this error?

~/autoawq$ CUDA_VISIBLE_DEVICES=0 python3 test.py 
Fetching 13 files: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 13/13 [00:00<00:00, 86963.24it/s]
Replacing layers...: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 40/40 [00:04<00:00,  9.63it/s]
Fusing layers...: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 40/40 [00:02<00:00, 18.21it/s]
Traceback (most recent call last):
  File "/home/jeffrey/autoawq/test.py", line 94, in <module>
    generated_output = model.generate(
  File "/home/jeffrey/.cache/pypoetry/virtualenvs/autoawq-MwlF3Uxe-py3.10/lib/python3.10/site-packages/awq/models/base.py", line 104, in generate
    return self.model.generate(*args, **kwargs)
  File "/home/jeffrey/.cache/pypoetry/virtualenvs/autoawq-MwlF3Uxe-py3.10/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/jeffrey/.cache/pypoetry/virtualenvs/autoawq-MwlF3Uxe-py3.10/lib/python3.10/site-packages/transformers/generation/utils.py", line 1544, in generate
    return self.greedy_search(
  File "/home/jeffrey/.cache/pypoetry/virtualenvs/autoawq-MwlF3Uxe-py3.10/lib/python3.10/site-packages/transformers/generation/utils.py", line 2401, in greedy_search
    model_inputs = self.prepare_inputs_for_generation(input_ids, **model_kwargs)
  File "/home/jeffrey/.cache/pypoetry/virtualenvs/autoawq-MwlF3Uxe-py3.10/lib/python3.10/site-packages/transformers/models/llama/modeling_llama.py", line 1256, in prepare_inputs_for_generation
    if past_key_value := getattr(self.model.layers[0].self_attn, "past_key_value", None):
  File "/home/jeffrey/.cache/pypoetry/virtualenvs/autoawq-MwlF3Uxe-py3.10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1688, in __getattr__
    raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'LlamaLikeModel' object has no attribute 'layers'

Sign up or log in to comment