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

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +11 -9
README.md CHANGED
@@ -25,18 +25,20 @@ pip install -U peft
25
  Now, the peft adapter can be loaded and activated like this:
26
 
27
  ```python
 
 
28
 
 
 
29
  ```
30
 
 
31
 
32
- ## More Information [optional]
33
-
34
- [More Information Needed]
35
-
36
- ## Model Card Authors [optional]
37
-
38
- [More Information Needed]
39
 
40
- ## Model Card Contact
 
41
 
42
- [More Information Needed]
 
 
25
  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
 
35
+ Now, to perform sentiment classification:
36
 
37
+ ```python
38
+ from transformers import AutoTokenizer, TextClassificationPipeline
 
 
 
 
 
39
 
40
+ tokenizer = AutoTokenizer.from_pretrained("roberta-base")
41
+ classifier = TextClassificationPipeline(model=model, tokenizer=tokenizer)
42
 
43
+ classifier("This is awesome!")
44
+ ```