jiangchengchengNLP commited on
Commit
b7c45f0
·
verified ·
1 Parent(s): 8a0ea85

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +16 -1
README.md CHANGED
@@ -84,7 +84,7 @@ sampling_params=SamplingParams(
84
  skip_special_tokens=True,
85
  temperature=0.0
86
  )
87
- # For the exact raspberry sample in the paper see
88
  import re
89
  pattn=re.compile("\*\*Final Answer\*\*.*",re.S)
90
 
@@ -148,4 +148,19 @@ print("With budget forcing:")
148
  print(prompt + o[0].outputs[0].text)
149
  ```
150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  - PEFT 0.14.0
 
84
  skip_special_tokens=True,
85
  temperature=0.0
86
  )
87
+ # For the math sample
88
  import re
89
  pattn=re.compile("\*\*Final Answer\*\*.*",re.S)
90
 
 
148
  print(prompt + o[0].outputs[0].text)
149
  ```
150
 
151
+ ## If you want to combine lora weights into one model then use the following code
152
+
153
+ ```python
154
+ from peft import PeftModel
155
+ from transformers import AutoModelForCausalLM, AutoTokenizer
156
+ tokenizer = AutoTokenizer.from_pretrained("jiangchengchengNLP/qwen2.5-distill-QWQ")
157
+ base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-7B-Instruct",device_map='cpu',torch_dtype="bfloat16")
158
+ model = PeftModel.from_pretrained(base_model, "jiangchengchengNLP/qwen2.5-distill-QWQ")
159
+ mergemodel = model.merge_and_unload()
160
+ mergemodel.save_pretrained("./merge_model")
161
+ tokenizer.save_pretrained("./merge_model")
162
+ print("model have merged!")
163
+ ```
164
+
165
+
166
  - PEFT 0.14.0