chbenchi commited on
Commit
f322503
·
verified ·
1 Parent(s): c47ae2c

Push model using huggingface_hub.

Browse files
README.md ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: transformers
4
+ tags:
5
+ - trl
6
+ - ppo
7
+ - transformers
8
+ - reinforcement-learning
9
+ ---
10
+
11
+ # TRL Model
12
+
13
+ This is a [TRL language model](https://github.com/huggingface/trl) that has been fine-tuned with reinforcement learning to
14
+ guide the model outputs according to a value, function, or human feedback. The model can be used for text generation.
15
+
16
+ ## Usage
17
+
18
+ To use this model for inference, first install the TRL library:
19
+
20
+ ```bash
21
+ python -m pip install trl
22
+ ```
23
+
24
+ You can then generate text as follows:
25
+
26
+ ```python
27
+ from transformers import pipeline
28
+
29
+ generator = pipeline("text-generation", model="chbenchi//tmp/tmpd6ge2awh/chbenchi/mistral-ppo")
30
+ outputs = generator("Hello, my llama is cute")
31
+ ```
32
+
33
+ If you want to use the model for training or to obtain the outputs from the value head, load the model as follows:
34
+
35
+ ```python
36
+ from transformers import AutoTokenizer
37
+ from trl import AutoModelForCausalLMWithValueHead
38
+
39
+ tokenizer = AutoTokenizer.from_pretrained("chbenchi//tmp/tmpd6ge2awh/chbenchi/mistral-ppo")
40
+ model = AutoModelForCausalLMWithValueHead.from_pretrained("chbenchi//tmp/tmpd6ge2awh/chbenchi/mistral-ppo")
41
+
42
+ inputs = tokenizer("Hello, my llama is cute", return_tensors="pt")
43
+ outputs = model(**inputs, labels=inputs["input_ids"])
44
+ ```
config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "chbenchi/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
+ "rms_norm_eps": 1e-06,
20
+ "rope_theta": 10000.0,
21
+ "sliding_window": 768,
22
+ "tie_word_embeddings": false,
23
+ "torch_dtype": "float32",
24
+ "transformers_version": "4.44.2",
25
+ "use_cache": true,
26
+ "vocab_size": 32000
27
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "transformers_version": "4.44.2"
6
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f895de887681de6df42a8ced1c40268b07ebc92265b66044dba3c95883ddc8e2
3
+ size 338200972
special_tokens_map.json ADDED
@@ -0,0 +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
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
3
+ size 493443
tokenizer_config.json ADDED
@@ -0,0 +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": "left",
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
+ }