CoolFace
Modelpublic

AiAF/gemma-2-2b-it-co-sft-qlora

sourceHugging Facegemmaupdated 1y agoView on Hugging Face
0likes5downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

<img src="https://raw.githubusercontent.com/axolotl-ai-cloud/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/> <details><summary>See axolotl config</summary>

axolotl version: 0.13.0.dev0

yaml
# 1. Base Model & Tokenizer
base_model: google/gemma-2-2b-it
model_type: AutoModelForCausalLM # Corrected from 'type_of_model' for axolotl
tokenizer_type: AutoTokenizer
hub_model_id: AiAF/gemma-2-2b-it-co-sft-qlora # New model ID for this finetune
hub_strategy: checkpoint

# 2. LoRA / QLoRA Configuration
load_in_4bit: true
adapter: qlora
lora_r: 64
lora_alpha: 128
lora_dropout: 0.05
lora_target_linear: true

# 3. Dataset Configuration
datasets:
  - path: .
    type: chat_template
    # Use the data_files key for local files to avoid ambiguity
    data_files: ./co-sft-dataset.jsonl
    field_messages: conversations
    message_property_mappings:
      role: from
      content: value
    # Custom Jinja template for Gemma models
    chat_template: jinja
    chat_template_jinja: |
      {{ bos_token }}
      {% set last = None %}
      {% for m in messages %}
        {% set raw_role = 'model' if m['role']=='assistant' else m['role'] %}
        {% set role = 'user' if raw_role=='system' else raw_role %}
        {% if role == last and role == 'user' %}
          {{ m['content'] | trim }}
        {% else %}
          {{ '<start_of_turn>' + role + '\n' + m['content'] | trim + '<end_of_turn>\n' }}
        {% endif %}
        {% set last = role %}
      {% endfor %}
      {% if add_generation_prompt %}
      {{ '<start_of_turn>model\n' }}
      {% endif %}
    roles_to_train: ["assistant", "user"]

# 4. Training Parameters
sequence_len: 2048
sample_packing: true
eval_sample_packing: true
val_set_size: 0.05
num_epochs: 10
dataset_prepared_path: last_run_prepared

# 5. Saving and Evaluation Strategy
evals_per_epoch: 5
saves_per_epoch: 5
save_total_limit: 100

resume_from_checkpoint: outputs/sft/gemma-2-2b-it-co/checkpoint-15792/

# 6. Output & Logging
output_dir: ./outputs/sft/gemma-2-2b-it-co

wandb_project: "co-sft"
wandb_name: "gemma-2-2b-it_SFT-co_QLoRA"
wandb_log_model: "false"
wandb_run_id: "1"

# 7. Batching & Optimizer
gradient_accumulation_steps: 4
micro_batch_size: 1
optimizer: adamw_bnb_8bit
lr_scheduler: cosine
learning_rate: 0.0002
weight_decay: 0.0

# 8. Hardware & Performance
bf16: true
#fp16: true
tf32: true

flash_attention: true
gradient_checkpointing: true
logging_steps: 1

# 9. Special Tokens
eot_tokens: ["<end_of_turn>"]
special_tokens:
  bos_token: "<bos>"
  eos_token: "<eos>"
  pad_token: "<pad>"

</details><br>

gemma-2-2b-it-co-sft-qlora

This model is a fine-tuned version of google/gemma-2-2b-it on an unknown dataset. It achieves the following results on the evaluation set:

  • —Loss: 0.6665
  • —Memory/max Active (gib): 10.22
  • —Memory/max Allocated (gib): 10.22
  • —Memory/device Reserved (gib): 12.03

Model description

More information needed

Intended uses & limitations

More information needed

Training and evaluation data

More information needed

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • —learning_rate: 0.0002
  • —trainbatchsize: 1
  • —evalbatchsize: 1
  • —seed: 42
  • —gradientaccumulationsteps: 4
  • —totaltrainbatch_size: 4
  • —optimizer: Use OptimizerNames.ADAMWBNB with betas=(0.9,0.999) and epsilon=1e-08 and optimizerargs=No additional optimizer arguments
  • —lrschedulertype: cosine
  • —lrschedulerwarmup_steps: 100
  • —training_steps: 28170

Training results

Training LossEpochStepValidation LossReserved (gib)Active (gib)Allocated (gib)
No log003.90148.667.617.61
2.27790.20025642.263811.4210.1810.18
2.08140.400411282.081911.410.1810.18
1.92610.600616921.952911.410.1810.18
1.78370.800822561.836211.410.1810.18
1.70391.000728201.711511.410.1810.18
1.35811.200933841.628811.410.1810.18
1.27751.401139481.540611.410.1810.18
1.20311.601345121.472911.410.1810.18
1.1791.801550761.437911.410.1810.18
1.16871.999656341.43108.827.777.77
1.16872.001856401.462811.4210.1810.18
1.13562.202062041.504211.410.1810.18
1.10692.402267681.444011.410.1810.18
1.10332.602473321.391111.410.1810.18
1.05772.802678961.320211.410.1810.18
1.00843.002584601.296411.410.1810.18
0.71523.202790241.280411.410.1810.18
0.77683.402995881.255511.410.1810.18
0.73853.6031101521.241411.410.1810.18
0.72683.8033107161.233711.410.1810.18
0.7423.9992112681.23318.827.777.77
0.7424.0032112801.263611.4210.1810.18
0.99754.2034118441.415711.410.1810.18
1.09044.4036124081.425311.410.1810.18
1.0884.6038129721.391311.410.1810.18
1.06224.8040135361.351511.410.1810.18
0.9935.0043141001.355711.47.787.78
0.85395.2045146641.328111.410.1810.18
0.83465.4046152281.290811.410.1810.18
0.87935.6048157921.246011.410.1810.18
0.87935.6048157920.70407.797.798.84
0.75325.8062163560.719410.2210.2212.26
0.77796.0064169200.719210.2210.2212.03
0.68736.2066174840.719010.2210.2212.03
0.69356.4068180480.709610.2210.2212.03
0.68586.6070186120.696810.2210.2212.03
0.69366.8072191760.682310.2210.2212.03
0.64567.0075197400.673910.2210.2212.03
0.50757.2077203040.676010.2210.2212.03
0.51747.4079208680.669010.2210.2212.03
0.51557.6081214320.655410.2210.2212.03
0.48217.8083219960.647210.2210.2212.03
0.4778.0085225600.663010.2210.2212.03
0.39818.2087231240.662910.2210.2212.03
0.39178.4089236880.660210.2210.2212.03
0.40088.6092242520.655210.2210.2212.03
0.40038.8094248160.649810.2210.2212.03
0.41029.0096253800.663110.2210.2212.03
0.35269.2098259440.668110.2210.2212.03
0.3499.4100265080.666410.2210.2212.03
0.35219.6102270720.666910.2210.2212.03
0.34249.8104276360.666510.2210.2212.03

Framework versions

  • —PEFT 0.17.1
  • —Transformers 4.56.1
  • —Pytorch 2.7.1+cu126
  • —Datasets 4.0.0
  • —Tokenizers 0.22.1