Mert
commited on
Push model using huggingface_hub.
Browse files- README.md +43 -43
- config.json +28 -27
- generation_config.json +6 -6
- model.safetensors +1 -1
- special_tokens_map.json +30 -30
- tokenizer_config.json +50 -50
README.md
CHANGED
@@ -1,43 +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="gulmert89/
|
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("gulmert89/
|
39 |
-
model = AutoModelForCausalLMWithValueHead.from_pretrained("gulmert89/
|
40 |
-
|
41 |
-
inputs = tokenizer("Hello, my llama is cute", return_tensors="pt")
|
42 |
-
outputs = model(**inputs, labels=inputs["input_ids"])
|
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="gulmert89//tmp/tmphxi1_39z/gulmert89/mistral-ppo")
|
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("gulmert89//tmp/tmphxi1_39z/gulmert89/mistral-ppo")
|
39 |
+
model = AutoModelForCausalLMWithValueHead.from_pretrained("gulmert89//tmp/tmphxi1_39z/gulmert89/mistral-ppo")
|
40 |
+
|
41 |
+
inputs = tokenizer("Hello, my llama is cute", return_tensors="pt")
|
42 |
+
outputs = model(**inputs, labels=inputs["input_ids"])
|
43 |
+
```
|
config.json
CHANGED
@@ -1,27 +1,28 @@
|
|
1 |
-
{
|
2 |
-
"_name_or_path": "gulmert89/mistral-supervised",
|
3 |
-
"architectures": [
|
4 |
-
"MistralForCausalLM"
|
5 |
-
],
|
6 |
-
"attention_dropout": 0.0,
|
7 |
-
"bos_token_id": 1,
|
8 |
-
"eos_token_id": 2,
|
9 |
-
"head_dim": 48,
|
10 |
-
"hidden_act": "silu",
|
11 |
-
"hidden_size": 768,
|
12 |
-
"initializer_range": 0.02,
|
13 |
-
"intermediate_size": 3072,
|
14 |
-
"max_position_embeddings": 512,
|
15 |
-
"model_type": "mistral",
|
16 |
-
"num_attention_heads": 16,
|
17 |
-
"num_hidden_layers": 4,
|
18 |
-
"num_key_value_heads": 8,
|
19 |
-
"
|
20 |
-
"
|
21 |
-
"
|
22 |
-
"
|
23 |
-
"
|
24 |
-
"
|
25 |
-
"
|
26 |
-
"
|
27 |
-
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "gulmert89/mistral-supervised",
|
3 |
+
"architectures": [
|
4 |
+
"MistralForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"bos_token_id": 1,
|
8 |
+
"eos_token_id": 2,
|
9 |
+
"head_dim": 48,
|
10 |
+
"hidden_act": "silu",
|
11 |
+
"hidden_size": 768,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 3072,
|
14 |
+
"max_position_embeddings": 512,
|
15 |
+
"model_type": "mistral",
|
16 |
+
"num_attention_heads": 16,
|
17 |
+
"num_hidden_layers": 4,
|
18 |
+
"num_key_value_heads": 8,
|
19 |
+
"pad_token_id": 2,
|
20 |
+
"rms_norm_eps": 1e-06,
|
21 |
+
"rope_theta": 10000.0,
|
22 |
+
"sliding_window": 768,
|
23 |
+
"tie_word_embeddings": false,
|
24 |
+
"torch_dtype": "float32",
|
25 |
+
"transformers_version": "4.44.0",
|
26 |
+
"use_cache": true,
|
27 |
+
"vocab_size": 32000
|
28 |
+
}
|
generation_config.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
{
|
2 |
-
"_from_model_config": true,
|
3 |
-
"bos_token_id": 1,
|
4 |
-
"eos_token_id": 2,
|
5 |
-
"transformers_version": "4.44.
|
6 |
-
}
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 1,
|
4 |
+
"eos_token_id": 2,
|
5 |
+
"transformers_version": "4.44.0"
|
6 |
+
}
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 338200972
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:58d2eb494d83eb2ca54ac7f6bc0e7d059cdd0c471edbd8fc7b606301c582bbe2
|
3 |
size 338200972
|
special_tokens_map.json
CHANGED
@@ -1,30 +1,30 @@
|
|
1 |
-
{
|
2 |
-
"bos_token": {
|
3 |
-
"content": "<s>",
|
4 |
-
"lstrip": false,
|
5 |
-
"normalized": false,
|
6 |
-
"rstrip": false,
|
7 |
-
"single_word": false
|
8 |
-
},
|
9 |
-
"eos_token": {
|
10 |
-
"content": "</s>",
|
11 |
-
"lstrip": false,
|
12 |
-
"normalized": false,
|
13 |
-
"rstrip": false,
|
14 |
-
"single_word": false
|
15 |
-
},
|
16 |
-
"pad_token": {
|
17 |
-
"content": "</s>",
|
18 |
-
"lstrip": false,
|
19 |
-
"normalized": false,
|
20 |
-
"rstrip": false,
|
21 |
-
"single_word": false
|
22 |
-
},
|
23 |
-
"unk_token": {
|
24 |
-
"content": "<unk>",
|
25 |
-
"lstrip": false,
|
26 |
-
"normalized": false,
|
27 |
-
"rstrip": false,
|
28 |
-
"single_word": false
|
29 |
-
}
|
30 |
-
}
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "</s>",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"unk_token": {
|
24 |
+
"content": "<unk>",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
}
|
30 |
+
}
|
tokenizer_config.json
CHANGED
@@ -1,50 +1,50 @@
|
|
1 |
-
{
|
2 |
-
"add_bos_token": true,
|
3 |
-
"add_eos_token": false,
|
4 |
-
"add_prefix_space": null,
|
5 |
-
"added_tokens_decoder": {
|
6 |
-
"0": {
|
7 |
-
"content": "<unk>",
|
8 |
-
"lstrip": false,
|
9 |
-
"normalized": false,
|
10 |
-
"rstrip": false,
|
11 |
-
"single_word": false,
|
12 |
-
"special": true
|
13 |
-
},
|
14 |
-
"1": {
|
15 |
-
"content": "<s>",
|
16 |
-
"lstrip": false,
|
17 |
-
"normalized": false,
|
18 |
-
"rstrip": false,
|
19 |
-
"single_word": false,
|
20 |
-
"special": true
|
21 |
-
},
|
22 |
-
"2": {
|
23 |
-
"content": "</s>",
|
24 |
-
"lstrip": false,
|
25 |
-
"normalized": false,
|
26 |
-
"rstrip": false,
|
27 |
-
"single_word": false,
|
28 |
-
"special": true
|
29 |
-
}
|
30 |
-
},
|
31 |
-
"additional_special_tokens": [],
|
32 |
-
"bos_token": "<s>",
|
33 |
-
"clean_up_tokenization_spaces": false,
|
34 |
-
"eos_token": "</s>",
|
35 |
-
"legacy": false,
|
36 |
-
"max_length": 512,
|
37 |
-
"model_max_length": 1000000000000000019884624838656,
|
38 |
-
"pad_to_multiple_of": null,
|
39 |
-
"pad_token": "</s>",
|
40 |
-
"pad_token_type_id": 0,
|
41 |
-
"padding_side": "
|
42 |
-
"sp_model_kwargs": {},
|
43 |
-
"spaces_between_special_tokens": false,
|
44 |
-
"stride": 0,
|
45 |
-
"tokenizer_class": "LlamaTokenizer",
|
46 |
-
"truncation_side": "right",
|
47 |
-
"truncation_strategy": "longest_first",
|
48 |
-
"unk_token": "<unk>",
|
49 |
-
"use_default_system_prompt": false
|
50 |
-
}
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": null,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<unk>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"2": {
|
23 |
+
"content": "</s>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": false,
|
26 |
+
"rstrip": false,
|
27 |
+
"single_word": false,
|
28 |
+
"special": true
|
29 |
+
}
|
30 |
+
},
|
31 |
+
"additional_special_tokens": [],
|
32 |
+
"bos_token": "<s>",
|
33 |
+
"clean_up_tokenization_spaces": false,
|
34 |
+
"eos_token": "</s>",
|
35 |
+
"legacy": false,
|
36 |
+
"max_length": 512,
|
37 |
+
"model_max_length": 1000000000000000019884624838656,
|
38 |
+
"pad_to_multiple_of": null,
|
39 |
+
"pad_token": "</s>",
|
40 |
+
"pad_token_type_id": 0,
|
41 |
+
"padding_side": "right",
|
42 |
+
"sp_model_kwargs": {},
|
43 |
+
"spaces_between_special_tokens": false,
|
44 |
+
"stride": 0,
|
45 |
+
"tokenizer_class": "LlamaTokenizer",
|
46 |
+
"truncation_side": "right",
|
47 |
+
"truncation_strategy": "longest_first",
|
48 |
+
"unk_token": "<unk>",
|
49 |
+
"use_default_system_prompt": false
|
50 |
+
}
|