Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AttributeError: 'Qwen2VLForConditionalGeneration' object has no attribute 'quantize'. Did you mean: 'dequantize'? #2039

Closed
CachCheng opened this issue Sep 14, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@CachCheng
Copy link

[INFO:swift] Qwen2VLForConditionalGeneration: 8291.3756M Params (0.0000M Trainable [0.0000%]), 234.8828M Buffers.
[INFO:swift] system: You are a helpful assistant.
[INFO:swift] Quantization dataset: ['ms-bench']
[INFO:swift] Start quantizing the model...
Traceback (most recent call last):
File "/meta/cash/llm/swift/swift/cli/export.py", line 5, in
export_main()
File "/meta/cash/llm/swift/swift/utils/run_utils.py", line 32, in x_main
result = llm_x(args, **kwargs)
File "/meta/cash/llm/swift/swift/llm/export.py", line 252, in llm_export
awq_model_quantize(model, template.tokenizer, args.quant_batch_size)
File "/meta/cash/llm/swift/swift/llm/export.py", line 138, in awq_model_quantize
awq_model.quantize(tokenizer, quant_config=quant_config, n_parallel_calib_samples=batch_size)
File "/home/ahs/anaconda3/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1729, in getattr
raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
AttributeError: 'Qwen2VLForConditionalGeneration' object has no attribute 'quantize'. Did you mean: 'dequantize'?

@tastelikefeet tastelikefeet added the bug Something isn't working label Sep 20, 2024
@Jintao-Huang
Copy link
Collaborator

fixed

@CachCheng
Copy link
Author

I have update the ms-swift and transformers to the latest, but this error still exist:

[INFO:swift] Start quantizing the model...
Traceback (most recent call last):
File "/meta/cash/llm/swift/swift/cli/export.py", line 5, in
export_main()
File "/meta/cash/llm/swift/swift/utils/run_utils.py", line 32, in x_main
result = llm_x(args, **kwargs)
File "/meta/cash/llm/swift/swift/llm/export.py", line 259, in llm_export
awq_model_quantize(model, template.tokenizer, args.quant_batch_size)
File "/meta/cash/llm/swift/swift/llm/export.py", line 93, in awq_model_quantize
awq_model.quantize(tokenizer, quant_config=quant_config, n_parallel_calib_samples=batch_size)
File "/home/ahs/anaconda3/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1729, in getattr
raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
AttributeError: 'Qwen2VLForConditionalGeneration' object has no attribute 'quantize'. Did you mean: 'dequantize'?

@Jintao-Huang
Copy link
Collaborator

please use ms-swift>=2.5

@CachCheng
Copy link
Author

$ pip list | grep ms-swift
ms-swift 2.6.0.dev0 /meta/cash/llm/swift

I have used the latest version from source code

@Jintao-Huang
Copy link
Collaborator

please use gptq

awq not support qwen2vl

casper-hansen/AutoAWQ#599

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants