You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromtransformersimportAutoModelForCausalLM, AutoTokenizerdevice="cuda"# the device to load the model ontomodel=AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen1.5-7B-Chat-GPTQ-Int8",
torch_dtype="auto",
device_map="auto"
)
tokenizer=AutoTokenizer.from_pretrained("Qwen/Qwen1.5-7B-Chat-GPTQ-Int8")
prompt="Give me a short introduction to large language model."messages= [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": prompt}
]
text=tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs=tokenizer([text], return_tensors="pt").to(device)
generated_ids=model.generate(
model_inputs.input_ids,
max_new_tokens=512
)
generated_ids= [
output_ids[len(input_ids):] forinput_ids, output_idsinzip(model_inputs.input_ids, generated_ids)
]
response=tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
错误
Some weights of the model checkpoint at /home/admin/workspace/aop_lab/app_source/Qwen-1.8B-8bit-gptq-1 were not used when initializing Qwen2ForCausalLM: ['model.layers.0.mlp.down_proj.bias', 'model.layers.0.mlp.down_proj.g_idx', 'model.layers.0.mlp.down_proj.qweight', 'model.layers.0.mlp.down_proj.qzeros', 'model.layers.0.mlp.down_proj.scales', 'model.layers.0.mlp.gate_proj.bias', 'model.layers.0.mlp.gate_proj.g_idx', 'model.layers.0.mlp.gate_proj.qweight', 'model.layers.0.mlp.gate_proj.qzeros', 'model.layers.0.mlp.gate_proj.scales', 'model.layers.0.mlp.up_proj.bias', 'model.layers.0.mlp.up_proj.g_idx', 'model.layers.0.mlp.up_proj.qweight', 'model.layers.0.mlp.up_proj.qzeros', 'model.layers.0.mlp.up_proj.scales', 'model.layers.0.self_attn.k_proj.g_idx', 'model.layers.0.self_attn.k_proj.qweight', 'model.layers.0.self_attn.k_proj.qzeros', 'model.layers.0.self_attn.k_proj.scales', 'model.layers.0.self_attn.o_proj.bias', 'model.layers.0.self_attn.o_proj.g_idx', 'model.layers.0.self_attn.o_proj.qweight', 'model.layers.0.self_attn.o_proj.qzeros', 'model.layers.0.self_attn.o_proj.scales', 'model.layers.0.self_attn.q_proj.g_idx', 'model.layers.0.self_attn.q_proj.qweight', 'model.layers.0.self_attn.q_proj.qzeros', 'model.layers.0.self_attn.q_proj.scales', 'model.layers.0.self_attn.v_proj.g_idx', 'model.layers.0.self_attn.v_proj.qweight', 'model.layers.0.self_attn.v_proj.qzeros', 'mode...省略。
The text was updated successfully, but these errors were encountered:
wellcasa
changed the title
A10 量化14B,推理失败,出现 Some weights of the model checkpoint at /Qwen-1.8B-8bit-gptq-1 were not used when initializing Qwen2ForCausalLM:
A10 量化1.8B,推理失败,出现 Some weights of the model checkpoint at /Qwen-1.8B-8bit-gptq-1 were not used when initializing Qwen2ForCausalLM:
Apr 2, 2024
版本
量化代码和官方一致。
加载和官方一致,仅仅改了地址
错误
推理出现乱码
The text was updated successfully, but these errors were encountered: