MRNH commited on
Commit
90f5bee
1 Parent(s): d0da7ba

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -0
README.md CHANGED
@@ -3,8 +3,18 @@ library_name: peft
3
  ---
4
 
5
  # Load the Lora model
 
 
 
 
6
 
 
 
 
 
7
 
 
 
8
  ## Training procedure
9
 
10
  ### Framework versions
 
3
  ---
4
 
5
  # Load the Lora model
6
+ '''
7
+ import torch
8
+ from peft import PeftModel, PeftConfig
9
+ from transformers import AutoModelForCausalLM, AutoTokenizer
10
 
11
+ peft_model_id = "lucas0/empath-llama-7b"
12
+ config = PeftConfig.from_pretrained(peft_model_id)
13
+ model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=True, device_map='auto')
14
+ tokenizer = AutoTokenizer.from_pretrained(cwd+"/tokenizer.model")
15
 
16
+ model = PeftModel.from_pretrained(model, peft_model_id)
17
+ '''
18
  ## Training procedure
19
 
20
  ### Framework versions