Update README.md
Browse files
README.md
CHANGED
@@ -2,4 +2,15 @@
|
|
2 |
license: mit
|
3 |
datasets:
|
4 |
- Anthropic/hh-rlhf
|
5 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
license: mit
|
3 |
datasets:
|
4 |
- Anthropic/hh-rlhf
|
5 |
+
---
|
6 |
+
```python
|
7 |
+
from transformers import AutoTokenizer, GPT2ForSequenceClassification
|
8 |
+
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained("microsoft/DialogRPT-updown")
|
10 |
+
model = GPT2ForSequenceClassification.from_pretrained("sugam11/gpt2-rlhf-reward")
|
11 |
+
|
12 |
+
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
|
13 |
+
|
14 |
+
with torch.no_grad():
|
15 |
+
logits = model(**inputs).logits
|
16 |
+
|