taku-yoshioka
commited on
Commit
•
42a9ffd
1
Parent(s):
ffda1be
Push model using huggingface_hub.
Browse files- README.md +43 -0
- adapter_config.json +25 -0
- adapter_model.safetensors +3 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +21 -0
- spiece.model +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +76 -0
README.md
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- trl
|
5 |
+
- ppo
|
6 |
+
- transformers
|
7 |
+
- reinforcement-learning
|
8 |
+
---
|
9 |
+
|
10 |
+
# TRL Model
|
11 |
+
|
12 |
+
This is a [TRL language model](https://github.com/huggingface/trl) that has been fine-tuned with reinforcement learning to
|
13 |
+
guide the model outputs according to a value, function, or human feedback. The model can be used for text generation.
|
14 |
+
|
15 |
+
## Usage
|
16 |
+
|
17 |
+
To use this model for inference, first install the TRL library:
|
18 |
+
|
19 |
+
```bash
|
20 |
+
python -m pip install trl
|
21 |
+
```
|
22 |
+
|
23 |
+
You can then generate text as follows:
|
24 |
+
|
25 |
+
```python
|
26 |
+
from transformers import pipeline
|
27 |
+
|
28 |
+
generator = pipeline("text-generation", model="taku-yoshioka//tmp/tmpcguvqmor/taku-yoshioka/rlhf_llm_custom_rm")
|
29 |
+
outputs = generator("Hello, my llama is cute")
|
30 |
+
```
|
31 |
+
|
32 |
+
If you want to use the model for training or to obtain the outputs from the value head, load the model as follows:
|
33 |
+
|
34 |
+
```python
|
35 |
+
from transformers import AutoTokenizer
|
36 |
+
from trl import AutoModelForCausalLMWithValueHead
|
37 |
+
|
38 |
+
tokenizer = AutoTokenizer.from_pretrained("taku-yoshioka//tmp/tmpcguvqmor/taku-yoshioka/rlhf_llm_custom_rm")
|
39 |
+
model = AutoModelForCausalLMWithValueHead.from_pretrained("taku-yoshioka//tmp/tmpcguvqmor/taku-yoshioka/rlhf_llm_custom_rm")
|
40 |
+
|
41 |
+
inputs = tokenizer("Hello, my llama is cute", return_tensors="pt")
|
42 |
+
outputs = model(**inputs, labels=inputs["input_ids"])
|
43 |
+
```
|
adapter_config.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"alpha_pattern": {},
|
3 |
+
"auto_mapping": null,
|
4 |
+
"base_model_name_or_path": "line-corporation/japanese-large-lm-1.7b",
|
5 |
+
"bias": "none",
|
6 |
+
"fan_in_fan_out": true,
|
7 |
+
"inference_mode": true,
|
8 |
+
"init_lora_weights": true,
|
9 |
+
"layers_pattern": null,
|
10 |
+
"layers_to_transform": null,
|
11 |
+
"loftq_config": {},
|
12 |
+
"lora_alpha": 32,
|
13 |
+
"lora_dropout": 0.05,
|
14 |
+
"megatron_config": null,
|
15 |
+
"megatron_core": "megatron.core",
|
16 |
+
"modules_to_save": null,
|
17 |
+
"peft_type": "LORA",
|
18 |
+
"r": 16,
|
19 |
+
"rank_pattern": {},
|
20 |
+
"revision": null,
|
21 |
+
"target_modules": [
|
22 |
+
"c_attn"
|
23 |
+
],
|
24 |
+
"task_type": "CAUSAL_LM"
|
25 |
+
}
|
adapter_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fc44457bd8e516b70ff7c3e71654b4433f049c2529e39de60d5963495257075f
|
3 |
+
size 14162008
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0ed623586921e4afd228c2c986c88c63b53ed53a3223393855e97472ea89c712
|
3 |
+
size 10748
|
special_tokens_map.json
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "<s>",
|
3 |
+
"cls_token": "<cls>",
|
4 |
+
"eos_token": {
|
5 |
+
"content": "</s>",
|
6 |
+
"lstrip": false,
|
7 |
+
"normalized": false,
|
8 |
+
"rstrip": false,
|
9 |
+
"single_word": false
|
10 |
+
},
|
11 |
+
"mask_token": "<mask>",
|
12 |
+
"pad_token": "</s>",
|
13 |
+
"sep_token": "<sep>",
|
14 |
+
"unk_token": {
|
15 |
+
"content": "<unk>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false
|
20 |
+
}
|
21 |
+
}
|
spiece.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0c5c56a739832923347681ed8a03a9cbf5afb6d1fe60089a5b01dd2dd063ab71
|
3 |
+
size 1208648
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "<unk>",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"1": {
|
12 |
+
"content": "<s>",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"2": {
|
20 |
+
"content": "</s>",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"3": {
|
28 |
+
"content": "<pad>",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"4": {
|
36 |
+
"content": "<sep>",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
},
|
43 |
+
"5": {
|
44 |
+
"content": "<mask>",
|
45 |
+
"lstrip": false,
|
46 |
+
"normalized": false,
|
47 |
+
"rstrip": false,
|
48 |
+
"single_word": false,
|
49 |
+
"special": true
|
50 |
+
},
|
51 |
+
"6": {
|
52 |
+
"content": "<cls>",
|
53 |
+
"lstrip": false,
|
54 |
+
"normalized": false,
|
55 |
+
"rstrip": false,
|
56 |
+
"single_word": false,
|
57 |
+
"special": true
|
58 |
+
}
|
59 |
+
},
|
60 |
+
"additional_special_tokens": [],
|
61 |
+
"bos_token": "<s>",
|
62 |
+
"clean_up_tokenization_spaces": true,
|
63 |
+
"cls_token": "<cls>",
|
64 |
+
"do_lower_case": false,
|
65 |
+
"eos_token": "</s>",
|
66 |
+
"extra_ids": 0,
|
67 |
+
"keep_accents": true,
|
68 |
+
"legacy": true,
|
69 |
+
"mask_token": "<mask>",
|
70 |
+
"model_max_length": 1000000000000000019884624838656,
|
71 |
+
"pad_token": "</s>",
|
72 |
+
"sep_token": "<sep>",
|
73 |
+
"sp_model_kwargs": {},
|
74 |
+
"tokenizer_class": "T5Tokenizer",
|
75 |
+
"unk_token": "<unk>"
|
76 |
+
}
|