Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[BUG] <title>量化后推理报错 #484

Open
2 tasks done
Stark-zheng opened this issue Oct 24, 2024 · 2 comments
Open
2 tasks done

[BUG] <title>量化后推理报错 #484

Stark-zheng opened this issue Oct 24, 2024 · 2 comments

Comments

@Stark-zheng
Copy link

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

  • 我已经搜索过已有的issues和讨论 | I have searched the existing issues / discussions

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

  • 我已经搜索过FAQ | I have searched FAQ

当前行为 | Current Behavior

微调量化后推理报错

推理代码:
from transformers import AutoTokenizer, TextGenerationPipeline, AutoModelForCausalLM

quantized_model_dir = "xxx_int4"

model = AutoModelForCausalLM.from_pretrained(
quantized_model_dir,
device_map="auto",
trust_remote_code=True
).eval()

Either a local path or an url between tags.

image_path = 'xxx/image1.png'
response, history = model.chat(tokenizer, query=f'{image_path}这是什么', history=None)
print(response)

错误:
OSError: /datadisk2/_1009_qlora_ds_adddataset_cleanv1_int4 does not appear to have a file named modeling_qwen.py. Checkout 'https://huggingface.co//datadisk2/_1009_qlora_ds_adddataset_cleanv1_int4/tree/None' for available files.

使用vllm部署报错:

KeyError: 'transformer.h.0.attn.c_attn.g_idx'

期望行为 | Expected Behavior

No response

复现方法 | Steps To Reproduce

No response

运行环境 | Environment

- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA (`python -c 'import torch; print(torch.version.cuda)'`):

备注 | Anything else?

No response

@Stark-zheng
Copy link
Author

量化完直接推理:response, history = model.chat(tokenizer, query=test_data[0], history=None)

报错:AttributeError: 'QuantLinear' object has no attribute 'q4'

@AuTingU
Copy link

AuTingU commented Nov 15, 2024

解决了吗?请问。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants