UsernameJustAnother commited on
Commit
0a7c9c1
1 Parent(s): 0ad0f1c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +97 -1
README.md CHANGED
@@ -1 +1,97 @@
1
- Q8_0 GGUF of https://huggingface.co/UsernameJustAnother/Nemo-12B-Marlin-v4/blob/main/README.md
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: unsloth/Mistral-Nemo-Instruct-2407
3
+ language:
4
+ - en
5
+ license: apache-2.0
6
+ tags:
7
+ - text-generation-inference
8
+ - transformers
9
+ - unsloth
10
+ - mistral
11
+ - trl
12
+ - rp
13
+ - gguf
14
+ - experimental
15
+ - long-context
16
+ ---
17
+
18
+ # Uploaded model
19
+
20
+ - **Developed by:** UsernameJustAnother
21
+ - **License:** apache-2.0
22
+ - **Finetuned from model :** unsloth/Mistral-Nemo-Instruct-2407
23
+
24
+ This is the Q8_0 GGUF of the 4th (and likely final) experimental fine-tune of Nemo. I made these to teach myself the basics of fine-tuning, with notes extensively borrowed from https://huggingface.co/nothingiisreal/MN-12B-Celeste-V1.9
25
+
26
+ It is an RP finetune using 8,160 human-generated conversations of varying lengths from a variety of sources, trained in ChatML format.
27
+
28
+ The big differences from Celeste is a different LoRA scaling factor. Celeste uses 8; I did several tests with this data before concluding I got lower training loss with 2.
29
+
30
+ Training took around 4 hours on a single Colab A100 (but I didn't do an eval loop). Neat that I could get it all to fit into 40GB of vRAM thanks to Unsloth.
31
+
32
+ It was trained with the following settings:
33
+
34
+ ```
35
+ ==((====))== Unsloth - 2x faster free finetuning | Num GPUs = 1
36
+ \\ /| Num examples = 8,160 | Num Epochs = 2
37
+ O^O/ \_/ \ Batch size per device = 2 | Gradient Accumulation steps = 4
38
+ \ / Total batch size = 8 | Total steps = 2,040
39
+ "-____-" Number of trainable parameters = 912,261,120
40
+
41
+ [2040/2040 3:35:30, Epoch 2/2]
42
+
43
+ model = FastLanguageModel.get_peft_model(
44
+ model,
45
+ r = 256,
46
+ target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
47
+ "gate_proj", "up_proj", "down_proj",],
48
+ lora_alpha = 32, # 32 / sqrt(256) gives a scaling factor of 2
49
+ lora_dropout = 0, # Supports any, but = 0 is optimized
50
+ bias = "none", # Supports any, but = "none" is optimized
51
+ # [NEW] "unsloth" uses 30% less VRAM, fits 2x larger batch sizes!
52
+ use_gradient_checkpointing = "unsloth", # True or "unsloth" for very long context
53
+ random_state = 3407,
54
+ use_rslora = True, # setting the adapter scaling factor to lora_alpha/math.sqrt(r) instead of lora_alpha/r
55
+ loftq_config = None, # And LoftQ
56
+ )
57
+
58
+ lr_scheduler_kwargs = {
59
+ 'min_lr': 0.0000024 # Adjust this value as needed
60
+ }
61
+
62
+ trainer = SFTTrainer(
63
+ model = model,
64
+ tokenizer = tokenizer,
65
+ train_dataset = train_ds,
66
+ compute_metrics = compute_metrics,
67
+ dataset_text_field = "text",
68
+ max_seq_length = max_seq_length,
69
+ dataset_num_proc = 2,
70
+ packing = False, # Can make training 5x faster for short sequences.
71
+ args = TrainingArguments(
72
+ per_device_train_batch_size = 2,
73
+ per_device_eval_batch_size = 2, # defaults to 8!
74
+ gradient_accumulation_steps = 4,
75
+ warmup_steps = 5,
76
+ num_train_epochs = 2,
77
+ learning_rate = 8e-5,
78
+ fp16 = not is_bfloat16_supported(),
79
+ bf16 = is_bfloat16_supported(),
80
+ fp16_full_eval = True, # stops eval from trying to use fp32
81
+ eval_strategy = "no", # 'no', 'steps', 'epoch'. Don't use this without an eval dataset etc
82
+ eval_steps = 1, # is eval_strat is set to 'steps', do every N steps.
83
+ logging_steps = 1, # so eval and logging happen on the same schedule
84
+ optim = "adamw_8bit",
85
+ weight_decay = 0.01,
86
+ lr_scheduler_type = "cosine_with_min_lr", # linear, cosine, cosine_with_min_lr, default linear
87
+ lr_scheduler_kwargs = lr_scheduler_kwargs, # needed for cosine_with_min_lr
88
+ seed = 3407,
89
+ output_dir = "outputs",
90
+ ),
91
+ )
92
+
93
+ ```
94
+
95
+ This mistral model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
96
+
97
+ [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)