nteku1 commited on
Commit
304a5b7
1 Parent(s): 09b8454

Push model using huggingface_hub.

Browse files
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="nteku1//tmp/tmpna3f85ey/nteku1/Jon_GPT2L_PPO_epi_inf")
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("nteku1//tmp/tmpna3f85ey/nteku1/Jon_GPT2L_PPO_epi_inf")
39
+ model = AutoModelForCausalLMWithValueHead.from_pretrained("nteku1//tmp/tmpna3f85ey/nteku1/Jon_GPT2L_PPO_epi_inf")
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,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "openai-community/gpt2-large",
5
+ "bias": "none",
6
+ "fan_in_fan_out": true,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layer_replication": null,
10
+ "layers_pattern": null,
11
+ "layers_to_transform": null,
12
+ "loftq_config": {},
13
+ "lora_alpha": 16,
14
+ "lora_dropout": 0.05,
15
+ "megatron_config": null,
16
+ "megatron_core": "megatron.core",
17
+ "modules_to_save": null,
18
+ "peft_type": "LORA",
19
+ "r": 16,
20
+ "rank_pattern": {},
21
+ "revision": null,
22
+ "target_modules": [
23
+ "c_attn"
24
+ ],
25
+ "task_type": "CAUSAL_LM",
26
+ "use_dora": false,
27
+ "use_rslora": false
28
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b22ea887760ae0ca2eae50993de9f33ec3e11d7ce3c096f965e0230fe11c4e87
3
+ size 11805792
config.json ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "accelerator_kwargs": {},
3
+ "adap_kl_ctrl": true,
4
+ "backward_batch_size": 1,
5
+ "batch_size": 4,
6
+ "cliprange": 0.2,
7
+ "cliprange_value": 0.2,
8
+ "compare_steps": 1,
9
+ "early_stopping": false,
10
+ "exp_name": "colab_kernel_launcher",
11
+ "forward_batch_size": null,
12
+ "gamma": 1,
13
+ "global_backward_batch_size": 1,
14
+ "global_batch_size": 4,
15
+ "gradient_accumulation_steps": 1,
16
+ "horizon": 10000,
17
+ "init_kl_coef": 0.2,
18
+ "is_encoder_decoder": false,
19
+ "is_peft_model": true,
20
+ "kl_penalty": "kl",
21
+ "lam": 0.95,
22
+ "learning_rate": 1.41e-05,
23
+ "log_with": null,
24
+ "max_grad_norm": null,
25
+ "mini_batch_size": 1,
26
+ "model_name": "Setpember/sft_gpt2_large",
27
+ "optimize_cuda_cache": true,
28
+ "optimize_device_cache": false,
29
+ "ppo_epochs": 4,
30
+ "project_kwargs": {},
31
+ "push_to_hub_if_best_kwargs": {},
32
+ "query_dataset": null,
33
+ "ratio_threshold": 10.0,
34
+ "remove_unused_columns": true,
35
+ "reward_model": null,
36
+ "score_clip": null,
37
+ "seed": 0,
38
+ "steps": 20000,
39
+ "target": 6,
40
+ "target_kl": 1,
41
+ "task_name": null,
42
+ "tracker_kwargs": {},
43
+ "tracker_project_name": "trl",
44
+ "use_score_norm": false,
45
+ "use_score_scaling": false,
46
+ "vf_coef": 0.1,
47
+ "whiten_rewards": false,
48
+ "world_size": 1
49
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a2917b6b84a6f3fc5c1d96e4b8c077677694b1617d0bf77e3ba48745b1f2d529
3
+ size 6652
special_tokens_map.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|endoftext|>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|endoftext|>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": "<|endoftext|>",
17
+ "unk_token": {
18
+ "content": "<|endoftext|>",
19
+ "lstrip": false,
20
+ "normalized": true,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ }
24
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "50256": {
5
+ "content": "<|endoftext|>",
6
+ "lstrip": false,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ }
12
+ },
13
+ "bos_token": "<|endoftext|>",
14
+ "clean_up_tokenization_spaces": true,
15
+ "device_map": {
16
+ "": 0
17
+ },
18
+ "eos_token": "<|endoftext|>",
19
+ "model_max_length": 1024,
20
+ "pad_token": "<|endoftext|>",
21
+ "tokenizer_class": "GPT2Tokenizer",
22
+ "unk_token": "<|endoftext|>"
23
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff