UsernameJustAnother commited on
Commit
9cbacda
1 Parent(s): e0b997b

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +95 -0
README.md ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: unsloth/Mistral-Nemo-Base-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
+ - writing
14
+ - gguf
15
+ - experimental
16
+ - long-context
17
+ ---
18
+
19
+ # Uploaded model
20
+
21
+ - **Developed by:** UsernameJustAnother
22
+ - **License:** apache-2.0
23
+ - **Finetuned from model :** unsloth/Mistral-Nemo-Base-2407
24
+
25
+ Standard disclaimer: This is me teaching myself the basics of fine-tuning, with notes extensively borrowed from https://huggingface.co/nothingiisreal/MN-12B-Celeste-V1.9
26
+
27
+ This is a Q_8.0 gguf of [UsernameJustAnother/Nemo-12B-Marlin-v8](https://huggingface.co/UsernameJustAnother/Nemo-12B-Marlin-v8).
28
+
29
+ New for v8:
30
+ - Fine-tuned on Nemo Base instead of Instruct, because why not?
31
+ - **FULL BORE MODE: ACTIVATE!** 10K-ish records of mostly-human convos and stories, curated by me, trained in ChatML, up from 8K in v6. Specifically:
32
+ - 4K records from Reddit Writing Prompts (equal split of highest-rated sfw & nfsw)
33
+ - 2K of Claude instruct, lightly curated & de-clauded.
34
+ - 2K of curated Fallen Skies
35
+ - 2K of curated/lightly de-ministrated C2 chat
36
+ - Trained on a single 80GB A100 from runpod.io, with batch size of 8 (up from 2 on A100 40G), so far less steps involved.
37
+
38
+ I pulled v7 because I honestly don't think it's as good as v6, and don't want folks to get the wrong idea that it's better just because the version number is higher.
39
+
40
+ Props again to Unsloth.ai for letting me train this on a single A100 with variable (wildly variable) context length.
41
+
42
+ Here's what the train/eval loss looked like:
43
+
44
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/662c17b252e194d5d436c708/hUKuy7ht_qObuFNDTVEe9.png)
45
+
46
+ I still don't know what makes training loss drop at the end of epoch 1, or why eval loss doesn't drop down to match (it continues to decrease, but slowly).
47
+
48
+ It was trained with the following settings:
49
+
50
+ ```
51
+
52
+ model = FastLanguageModel.get_peft_model(
53
+ model,
54
+ r = 256,
55
+ target_modules = ["q_proj", "k_proj", "v_proj", "o_proj",
56
+ "gate_proj", "up_proj", "down_proj",],
57
+ lora_alpha = 128, # 128 / sqrt(256) gives a scaling factor of 8
58
+ lora_dropout = 0.1, # Supports any, but = 0 is optimized
59
+ bias = "none", # Supports any, but = "none" is optimized
60
+ # [NEW] "unsloth" uses 30% less VRAM, fits 2x larger batch sizes!
61
+ use_gradient_checkpointing = "unsloth", # True or "unsloth" for very long context
62
+ random_state = 3407,
63
+ use_rslora = True, # setting the adapter scaling factor to lora_alpha/math.sqrt(r) instead of lora_alpha/r
64
+ loftq_config = None, # And LoftQ
65
+ )
66
+
67
+ lr_scheduler_kwargs = {
68
+ 'min_lr': 0.0000024 # Adjust this value as needed
69
+ }
70
+
71
+ per_device_train_batch_size = 8,
72
+ per_device_eval_batch_size = 8,
73
+ gradient_accumulation_steps = 4,
74
+ eval_accumulation_steps = 4,
75
+ prediction_loss_only = True, # When performing evaluation and generating predictions, only returns the loss.
76
+ warmup_steps = 50,
77
+ num_train_epochs = 2, # For longer training runs! 12 hrs/epoch?
78
+ learning_rate = 5e-5,
79
+ fp16 = not is_bfloat16_supported(),
80
+ bf16 = is_bfloat16_supported(),
81
+ fp16_full_eval = True, # stops eval from trying to use fp32
82
+ eval_strategy = "steps", # 'no', 'steps', 'epoch'. Don't use this without an eval dataset etc
83
+ eval_steps = 50, # is eval_strat is set to 'steps', do every N steps.
84
+ logging_steps = 5, # so eval and logging happen on the same schedule
85
+ optim = "adamw_8bit", #
86
+ weight_decay = 0, # up from 0
87
+ lr_scheduler_type = "cosine_with_min_lr", # linear, cosine, cosine_with_min_lr, default linear
88
+ lr_scheduler_kwargs = lr_scheduler_kwargs, # needed for cosine_with_min_lr
89
+ seed = 3407,
90
+
91
+ ```
92
+
93
+ This mistral model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
94
+
95
+ [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)