Views
No views yet
Qwen/Qwen2.5-7B-Instruct.transformers and peft. The base model weights are not included; they are loaded from Qwen/Qwen2.5-7B-Instruct.Qwen/Qwen2.5-7B-Instructq_proj, k_proj, v_proj, up_proj, down_proj1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3
4base_model = "Qwen/Qwen2.5-7B-Instruct"
5adapter_id = "tcy0512/FuelProp-LM"
6
7tokenizer = AutoTokenizer.from_pretrained(adapter_id, trust_remote_code=True)
8model = AutoModelForCausalLM.from_pretrained(
9 base_model,
10 device_map="auto",
11 torch_dtype="auto",
12 trust_remote_code=True,
13)
14model = PeftModel.from_pretrained(model, adapter_id)
15
16messages = [
17 {"role": "user", "content": "Please introduce yourself."}
18]
19text = tokenizer.apply_chat_template(
20 messages,
21 tokenize=False,
22 add_generation_prompt=True,
23)
24inputs = tokenizer([text], return_tensors="pt").to(model.device)
25outputs = model.generate(**inputs, max_new_tokens=512)
26print(tokenizer.decode(outputs[0], skip_special_tokens=True))Qwen/Qwen2.5-7B-Instruct. Users should evaluate the model carefully for their own domain and use case.Qwen/Qwen2.5-7B-Instruct and any applicable license terms for the fine-tuning data.