theblackcat102
commited on
Commit
·
6701392
1
Parent(s):
649408c
Update README.md
Browse files
README.md
CHANGED
@@ -33,6 +33,19 @@ All models are train on these dataset with a same split seed across datasets (if
|
|
33 |
- [synthetic-instruct-gptj-pairwise](https://huggingface.co/datasets/Dahoas/synthetic-instruct-gptj-pairwise)
|
34 |
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
# Performance
|
37 |
|
38 |
Validation split accuracy
|
|
|
33 |
- [synthetic-instruct-gptj-pairwise](https://huggingface.co/datasets/Dahoas/synthetic-instruct-gptj-pairwise)
|
34 |
|
35 |
|
36 |
+
# How to use
|
37 |
+
|
38 |
+
```
|
39 |
+
from transformer import AutoModelForSequenceClassification, AutoTokenizer
|
40 |
+
reward_name = "OpenAssistant/reward-model-deberta-v3-base"
|
41 |
+
rank_model, tokenizer = AutoModelForSequenceClassification.from_pretrained(reward_name), AutoTokenizer.from_pretrained(reward_name)
|
42 |
+
question, answer = "Explain nuclear fusion like I am five", "Nuclear fusion is the process by which two or more protons and neutrons combine to form a single nucleus. It is a very important process in the universe, as it is the source of energy for stars and galaxies. Nuclear fusion is also a key process in the production of energy for nuclear power plants."
|
43 |
+
inputs = tokenizer(question, answer, return_tensors='pt')
|
44 |
+
score = rank_model(**inputs).logits[0].cpu().detach()
|
45 |
+
print(score)
|
46 |
+
```
|
47 |
+
|
48 |
+
|
49 |
# Performance
|
50 |
|
51 |
Validation split accuracy
|