dtumkaya commited on
Commit
79ed98f
1 Parent(s): bc5a676

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - autotrain
4
+ - text-generation-inference
5
+ - text-generation
6
+ library_name: transformers
7
+ base_model: openai-community/gpt2
8
+ widget:
9
+ - messages:
10
+ - role: user
11
+ content: What is your favorite condiment?
12
+ license: other
13
+ datasets:
14
+ - borakaragul/wikitext2-raw-MIA
15
+ ---
16
+
17
+ # Model Trained Using AutoTrain
18
+
19
+ This model was trained using AutoTrain. For more information, please visit [AutoTrain](https://hf.co/docs/autotrain).
20
+
21
+ # Usage
22
+
23
+ ```python
24
+
25
+ from transformers import AutoModelForCausalLM, AutoTokenizer
26
+
27
+ model_path = "PATH_TO_THIS_REPO"
28
+
29
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
30
+ model = AutoModelForCausalLM.from_pretrained(
31
+ model_path,
32
+ device_map="auto",
33
+ torch_dtype='auto'
34
+ ).eval()
35
+
36
+ # Prompt content: "hi"
37
+ messages = [
38
+ {"role": "user", "content": "hi"}
39
+ ]
40
+
41
+ input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')
42
+ output_ids = model.generate(input_ids.to('cuda'))
43
+ response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
44
+
45
+ # Model response: "Hello! How can I assist you today?"
46
+ print(response)
47
+ ```
config.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "openai-community/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.44.1",
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.44.1"
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:d21f7cfc4f792479c6cf8c23dd9e25a693e7c90b05155f99a5826301a66ef01e
3
+ size 497774208
runs/Aug27_19-58-19_r-dtumkaya-autotrain-advanced-slm-v9sa1bek-fe930-j1sy4/events.out.tfevents.1724788704.r-dtumkaya-autotrain-advanced-slm-v9sa1bek-fe930-j1sy4.162.0 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a891929d37e888d5a9ba1b407b08ceb9d8718fed89c97f3f154a6df4e40f6e25
3
- size 5509
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b405ca6970f39b15edc250e544444ac1d87ef733a41453312d58b3f2827f36ec
3
+ size 10907
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:26f61bd8142be9a4501bea0ba185a9bc572dbeef7d3b418d8713d0a0efabae5f
3
+ size 5496
training_params.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "openai-community/gpt2",
3
+ "project_name": "autotrain-gpt2-5-slm",
4
+ "data_path": "borakaragul/wikitext2-raw-MIA",
5
+ "train_split": "train",
6
+ "valid_split": null,
7
+ "add_eos_token": true,
8
+ "block_size": 1024,
9
+ "model_max_length": 2048,
10
+ "padding": "right",
11
+ "trainer": "sft",
12
+ "use_flash_attention_2": false,
13
+ "log": "tensorboard",
14
+ "disable_gradient_checkpointing": false,
15
+ "logging_steps": -1,
16
+ "eval_strategy": "epoch",
17
+ "save_total_limit": 1,
18
+ "auto_find_batch_size": false,
19
+ "mixed_precision": "fp16",
20
+ "lr": 0.0001,
21
+ "epochs": 5,
22
+ "batch_size": 2,
23
+ "warmup_ratio": 0.1,
24
+ "gradient_accumulation": 4,
25
+ "optimizer": "adamw_torch",
26
+ "scheduler": "linear",
27
+ "weight_decay": 0.0,
28
+ "max_grad_norm": 1.0,
29
+ "seed": 42,
30
+ "chat_template": "none",
31
+ "quantization": "int4",
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_text",
45
+ "push_to_hub": true,
46
+ "username": "dtumkaya",
47
+ "unsloth": false
48
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff