PEFT
code
terryyz commited on
Commit
78e607a
1 Parent(s): bffe097

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -5
README.md CHANGED
@@ -99,11 +99,8 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
99
 
100
  peft_checkpoint = "bigcode/astraios-1b-lora"
101
  checkpoint = "bigcode/starcoderbase-1b"
102
- model = PeftModel.from_pretrained(checkpoint, peft_checkpoint)
103
- try:
104
- model.merge_and_unload()
105
- except:
106
- pass
107
  device = "cuda" # for GPU usage or "cpu" for CPU usage
108
 
109
  tokenizer = AutoTokenizer.from_pretrained(checkpoint)
 
99
 
100
  peft_checkpoint = "bigcode/astraios-1b-lora"
101
  checkpoint = "bigcode/starcoderbase-1b"
102
+ model = AutoModelForCausalLM.from_pretrained(checkpoint)
103
+ model = PeftModel.from_pretrained(model, peft_checkpoint)
 
 
 
104
  device = "cuda" # for GPU usage or "cpu" for CPU usage
105
 
106
  tokenizer = AutoTokenizer.from_pretrained(checkpoint)