solwol commited on
Commit
588fcec
·
verified ·
1 Parent(s): 5514fa2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +8 -3
README.md CHANGED
@@ -26,9 +26,14 @@ Now, the peft adapter can be loaded and activated like this:
26
 
27
  ```python
28
  from peft import PeftModel, PeftConfig
29
- from transformers import AutoModelForSequenceClassification
30
-
31
- model = AutoModelForSequenceClassification.from_pretrained("roberta-base")
 
 
 
 
 
32
  model = PeftModel.from_pretrained(model, "solwol/roberta-sentiment-classifier-peft")
33
  ```
34
 
 
26
 
27
  ```python
28
  from peft import PeftModel, PeftConfig
29
+ from transformers import AutoModelForSequenceClassification, RobertaConfig
30
+
31
+ config = RobertaConfig.from_pretrained(
32
+ "roberta-base",
33
+ num_labels=2,
34
+ id2label={ 0: "👎", 1: "👍"}
35
+ )
36
+ model = AutoModelForSequenceClassification.from_pretrained("roberta-base", config=config)
37
  model = PeftModel.from_pretrained(model, "solwol/roberta-sentiment-classifier-peft")
38
  ```
39