CoolFace
Modelpublic

AiAF/rp-2b

sourceHugging Facegemmaupdated 6mo agoView on Hugging Face
0likes9downloads
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/rp-2b # 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 (TRAIN = streamed)
streaming: true
streaming_multipack_buffer_size: 10000
sample_packing: true
datasets:
  - path: AiAF/conversations
    data_files: conversations_V3.jsonl
   # revision:
    type: chat_template
    split: train
    field_messages: conversations
    message_property_mappings:
      role: from
      content: value
    chat_template: jinja
    chat_template_jinja: |
      {{ bos_token }}
      {% for m in messages %}
        {% set role = 'model' if m['role']=='assistant' else 'user' %}
        {{ '<start_of_turn>' + role + '\n' + m['content'] | trim + '<end_of_turn>\n' }}
      {% endfor %}
      {% if add_generation_prompt %}
      {{ '<start_of_turn>model\n' }}
      {% endif %}

#    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"]
    train_on_eos: "turn"
# Use a fixed (non-streamed) eval file with the same schema/Jinja
test_datasets:
  - path: .
    name: json
    type: chat_template
    data_files: eval-datasets/shuf-1000_conversations_V2.jsonl        # small, representative eval slice
    split: train
    field_messages: conversations
    message_property_mappings:
      role: from
      content: value
    chat_template: jinja
    chat_template_jinja: |
      {{ bos_token }}
      {% for m in messages %}
        {% set role = 'model' if m['role']=='assistant' else 'user' %}
        {{ '<start_of_turn>' + role + '\n' + m['content'] | trim + '<end_of_turn>\n' }}
      {% endfor %}
      {% if add_generation_prompt %}
      {{ '<start_of_turn>model\n' }}
      {% endif %}
#    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"]

# 4. Training Parameters
sequence_len: 2048
sample_packing: true
eval_sample_packing: true
# val_set_size: 0.05            #  remove for streaming
# num_epochs: 10                 #  replace epochs with max_steps
max_steps: 1000                 #  set your target steps
dataset_prepared_path: last_run_prepared

# 5. Saving and Evaluation Strategy (use steps with streaming)
evaluation_strategy: steps
save_strategy: steps
eval_steps: 50
save_steps: 50
save_total_limit: 100

resume_from_checkpoint:

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

wandb_project: "rp-sft"
wandb_name: "gemma-2-2b-it-rp-sft-qlora"
wandb_log_model: "false"
wandb_run_id: "gemma-2-2b-it-rp-sft-qlora"

# 7. Batching & Optimizer
gradient_accumulation_steps: 4
micro_batch_size: 2
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>

rp-2b

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

  • Loss: 2.2455
  • Memory/max Active (gib): 7.78
  • Memory/max Allocated (gib): 7.78
  • Memory/device Reserved (gib): 17.79

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: 2
  • 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: 30
  • training_steps: 1000

Training results

Training LossEpochStepValidation LossActive (gib)Allocated (gib)Reserved (gib)
No log003.16547.617.618.66
2.73770.05502.59787.787.7817.75
2.39970.11002.55927.787.7817.79
2.62750.151502.54107.787.7817.79
2.81820.22002.52247.787.7817.79
2.44280.252502.49627.787.7817.79
2.62060.33002.46727.787.7817.79
2.44920.353502.44357.787.7817.79
2.27870.44002.41857.787.7817.79
2.5410.454502.39987.787.7817.79
2.55420.55002.36407.787.7817.79
2.68250.555502.34847.787.7817.79
2.63040.66002.32787.787.7817.79
2.48540.656502.31047.787.7817.79
2.37880.77002.28777.787.7817.79
2.21260.757502.27487.787.7817.79
2.46950.88002.26627.787.7817.79
2.50860.858502.25537.787.7817.79
2.4040.99002.24897.787.7817.79
2.40120.959502.24607.787.7817.79
2.25861.010002.24557.787.7817.79

Framework versions

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