CoolFace
Modelpublic

psychopenguin/legal_Phi-3-mini-4k-instruct

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes15downloads
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.16.0.dev0

yaml
seed: 9
auto_resume_from_checkpoints: True
tokenizer_save_jinja_files: True
gradient_checkpointing: True
trust_remote_code: False
tokenizer_use_fast: True
load_best_model_at_end: true

base_model: microsoft/Phi-3-mini-4k-instruct
model_type: AutoModelForCausalLM
tokenizer_type: AutoTokenizer
chat_template: tokenizer_default

datasets: 
  - path: psychopenguin/indian_legal_dataset_qna
    type: alpaca
    split: train

sample_packing: True               
pad_to_sequence_len: True 
sequence_len: 2048
bf16: True
tf32: True
adapter: lora
lora_target_linear: True
lora_r: 16
lora_alpha: 32
lora_dropout: 0.05

flash_attention: True
flash_attn_cross_entropy: True

optimizer: paged_adamw_8bit
learning_rate: 0.0002
lr_scheduler: cosine
gradient_accumulation_steps: 1
micro_batch_size: 9
num_epochs: 5    
neftune_noise_alpha: 5
early_stopping_patience: 5
save_steps: 100
save_total_limit: 3

val_set_size: 0.05
eval_strategy: steps
eval_steps: 100

use_wandb: True
wandb_project: major_project
wandb_name: legal-lm

output_dir: ./final_model
merge_lora: True
hf_use_auth_token: True
hub_model_id: psychopenguin/legal_Phi-3-mini-4k-instruct

</details><br>

legal_Phi-3-mini-4k-instruct

This model is a fine-tuned version of microsoft/Phi-3-mini-4k-instruct on the psychopenguin/indianlegaldataset_qna dataset. It achieves the following results on the evaluation set:

  • —Loss: 0.9185
  • —Ppl: 2.5055
  • —Memory/max Active (gib): 12.9
  • —Memory/max Allocated (gib): 12.9
  • —Memory/device Reserved (gib): 22.58

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: 9
  • —evalbatchsize: 9
  • —seed: 9
  • —optimizer: Use OptimizerNames.PAGEDADAMW8BIT with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
  • —lrschedulertype: cosine
  • —lrschedulerwarmup_steps: 35
  • —training_steps: 1195

Training results

Training LossEpochStepValidation LossPplActive (gib)Allocated (gib)Reserved (gib)
No log001.63745.141812.8812.8815.99
1.11670.41841001.12823.090112.912.922.02
1.05290.83682001.04702.849112.912.922.58
0.93291.25523000.98722.683712.912.922.58
0.91421.67364000.94272.566912.912.922.58
0.72922.09215000.92612.524612.912.922.58
0.75552.51056000.90382.469112.912.922.58
0.73132.92897000.87752.404812.912.922.58
0.62563.34738000.89892.456912.912.922.58
0.65653.76579000.88882.432312.912.922.58
0.54404.184110000.92012.509512.912.922.58
0.54204.602511000.91852.505512.912.922.58

Framework versions

  • —PEFT 0.18.1
  • —Transformers 5.3.0
  • —Pytorch 2.9.1+cu128
  • —Datasets 4.5.0
  • —Tokenizers 0.22.2