highest reward model
Browse files- README.md +42 -0
- merges.txt +0 -0
- pytorch_model.bin +1 -1
- special_tokens_map.json +6 -0
- tokenizer.json +0 -0
- tokenizer_config.json +34 -0
- vocab.json +0 -0
README.md
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- trl
|
5 |
+
- transformers
|
6 |
+
- reinforcement-learning
|
7 |
+
---
|
8 |
+
|
9 |
+
# TRL Model
|
10 |
+
|
11 |
+
This is a [TRL language model](https://github.com/lvwerra/trl) that has been fine-tuned with reinforcement learning to
|
12 |
+
guide the model outputs according to a value, function, or human feedback. The model can be used for text generation.
|
13 |
+
|
14 |
+
## Usage
|
15 |
+
|
16 |
+
To use this model for inference, first install the TRL library:
|
17 |
+
|
18 |
+
```bash
|
19 |
+
python -m pip install trl
|
20 |
+
```
|
21 |
+
|
22 |
+
You can then generate text as follows:
|
23 |
+
|
24 |
+
```python
|
25 |
+
from transformers import pipeline
|
26 |
+
|
27 |
+
generator = pipeline("text-generation", model="Bearnardd//tmp/tmpuxy4vyl8/Bearnardd/gpt2-imdb")
|
28 |
+
outputs = generator("Hello, my llama is cute")
|
29 |
+
```
|
30 |
+
|
31 |
+
If you want to use the model for training or to obtain the outputs from the value head, load the model as follows:
|
32 |
+
|
33 |
+
```python
|
34 |
+
from transformers import AutoTokenizer
|
35 |
+
from trl import AutoModelForCausalLMWithValueHead
|
36 |
+
|
37 |
+
tokenizer = AutoTokenizer.from_pretrained("Bearnardd//tmp/tmpuxy4vyl8/Bearnardd/gpt2-imdb")
|
38 |
+
model = AutoModelForCausalLMWithValueHead.from_pretrained("Bearnardd//tmp/tmpuxy4vyl8/Bearnardd/gpt2-imdb")
|
39 |
+
|
40 |
+
inputs = tokenizer("Hello, my llama is cute", return_tensors="pt")
|
41 |
+
outputs = model(**inputs, labels=inputs["input_ids"])
|
42 |
+
```
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pytorch_model.bin
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 510399237
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ed3a08a2388ff8fe19cba8821cc5d48565198a319e8637bb0054a690b7a8812e
|
3 |
size 510399237
|
special_tokens_map.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "<|endoftext|>",
|
3 |
+
"eos_token": "<|endoftext|>",
|
4 |
+
"pad_token": "<|endoftext|>",
|
5 |
+
"unk_token": "<|endoftext|>"
|
6 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": false,
|
3 |
+
"add_prefix_space": false,
|
4 |
+
"bos_token": {
|
5 |
+
"__type": "AddedToken",
|
6 |
+
"content": "<|endoftext|>",
|
7 |
+
"lstrip": false,
|
8 |
+
"normalized": true,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false
|
11 |
+
},
|
12 |
+
"eos_token": {
|
13 |
+
"__type": "AddedToken",
|
14 |
+
"content": "<|endoftext|>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": true,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false
|
19 |
+
},
|
20 |
+
"errors": "replace",
|
21 |
+
"max_len": 1024,
|
22 |
+
"model_max_length": 1024,
|
23 |
+
"pad_token": null,
|
24 |
+
"special_tokens_map_file": "/home/bearnard/.cache/huggingface/hub/models--lvwerra--gpt2-imdb/snapshots/f1bfd819c6bee6c18fa5f95bfe88d9198839a435/special_tokens_map.json",
|
25 |
+
"tokenizer_class": "GPT2Tokenizer",
|
26 |
+
"unk_token": {
|
27 |
+
"__type": "AddedToken",
|
28 |
+
"content": "<|endoftext|>",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": true,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false
|
33 |
+
}
|
34 |
+
}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|