ishmanish commited on
Commit
ed1271a
1 Parent(s): 01a8fbd

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - autotrain
4
+ - text-generation-inference
5
+ - text-generation
6
+ library_name: transformers
7
+ widget:
8
+ - messages:
9
+ - role: user
10
+ content: What is your favorite condiment?
11
+ license: other
12
+ ---
13
+
14
+ # Model Trained Using AutoTrain
15
+
16
+ This model was trained using AutoTrain. For more information, please visit [AutoTrain](https://hf.co/docs/autotrain).
17
+
18
+ # Usage
19
+
20
+ ```python
21
+
22
+ from transformers import AutoModelForCausalLM, AutoTokenizer
23
+
24
+ model_path = "PATH_TO_THIS_REPO"
25
+
26
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
27
+ model = AutoModelForCausalLM.from_pretrained(
28
+ model_path,
29
+ device_map="auto",
30
+ torch_dtype='auto'
31
+ ).eval()
32
+
33
+ # Prompt content: "hi"
34
+ messages = [
35
+ {"role": "user", "content": "hi"}
36
+ ]
37
+
38
+ input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')
39
+ output_ids = model.generate(input_ids.to('cuda'))
40
+ response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
41
+
42
+ # Model response: "Hello! How can I assist you today?"
43
+ print(response)
44
+ ```
config.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "gpt2",
3
+ "activation_function": "gelu_new",
4
+ "architectures": [
5
+ "GPT2LMHeadModel"
6
+ ],
7
+ "attn_pdrop": 0.1,
8
+ "bos_token_id": 50256,
9
+ "embd_pdrop": 0.1,
10
+ "eos_token_id": 50256,
11
+ "initializer_range": 0.02,
12
+ "layer_norm_epsilon": 1e-05,
13
+ "model_type": "gpt2",
14
+ "n_ctx": 1024,
15
+ "n_embd": 768,
16
+ "n_head": 12,
17
+ "n_inner": null,
18
+ "n_layer": 12,
19
+ "n_positions": 1024,
20
+ "reorder_and_upcast_attn": false,
21
+ "resid_pdrop": 0.1,
22
+ "scale_attn_by_inverse_layer_idx": false,
23
+ "scale_attn_weights": true,
24
+ "summary_activation": null,
25
+ "summary_first_dropout": 0.1,
26
+ "summary_proj_to_labels": true,
27
+ "summary_type": "cls_index",
28
+ "summary_use_proj": true,
29
+ "task_specific_params": {
30
+ "text-generation": {
31
+ "do_sample": true,
32
+ "max_length": 50
33
+ }
34
+ },
35
+ "torch_dtype": "float32",
36
+ "transformers_version": "4.41.0",
37
+ "use_cache": true,
38
+ "vocab_size": 50257
39
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 50256,
4
+ "eos_token_id": 50256,
5
+ "transformers_version": "4.41.0"
6
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b058e67a246a1444a6d62c754a325c46e40c89a1cb1878dfad6322c42142d56e
3
+ size 497774208
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,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
15
+ "clean_up_tokenization_spaces": true,
16
+ "eos_token": "<|endoftext|>",
17
+ "model_max_length": 1024,
18
+ "pad_token": "<|endoftext|>",
19
+ "tokenizer_class": "GPT2Tokenizer",
20
+ "unk_token": "<|endoftext|>"
21
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4cfb603e83b6203975149dc2c40fb365d36de890a9471d92de07804ffc97b35
3
+ size 5176
training_params.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "gpt2",
3
+ "project_name": "gpt2-autotrain-text-HrPolicy-aug5-30e-vfinal",
4
+ "data_path": "data/",
5
+ "train_split": "train",
6
+ "valid_split": null,
7
+ "add_eos_token": false,
8
+ "block_size": -1,
9
+ "model_max_length": 1024,
10
+ "padding": null,
11
+ "trainer": "sft",
12
+ "use_flash_attention_2": false,
13
+ "log": "none",
14
+ "disable_gradient_checkpointing": false,
15
+ "logging_steps": -1,
16
+ "evaluation_strategy": "epoch",
17
+ "save_total_limit": 1,
18
+ "auto_find_batch_size": false,
19
+ "mixed_precision": null,
20
+ "lr": 1e-05,
21
+ "epochs": 30,
22
+ "batch_size": 2,
23
+ "warmup_ratio": 0.1,
24
+ "gradient_accumulation": 1,
25
+ "optimizer": "adamw_torch",
26
+ "scheduler": "linear",
27
+ "weight_decay": 0.0,
28
+ "max_grad_norm": 1.0,
29
+ "seed": 42,
30
+ "chat_template": null,
31
+ "quantization": null,
32
+ "target_modules": "all-linear",
33
+ "merge_adapter": false,
34
+ "peft": false,
35
+ "lora_r": 16,
36
+ "lora_alpha": 32,
37
+ "lora_dropout": 0.05,
38
+ "model_ref": null,
39
+ "dpo_beta": 0.1,
40
+ "max_prompt_length": 128,
41
+ "max_completion_length": null,
42
+ "prompt_text_column": "prompt",
43
+ "text_column": "text",
44
+ "rejected_text_column": "rejected",
45
+ "push_to_hub": true,
46
+ "username": "ishmanish"
47
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff