
<!-- 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/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
<details><summary>See axolotl config</summary>

axolotl version: `0.3.0`
```yaml
base_model: cmcmaster/rheumphi-pretrain
model_type: PhiForCausalLM
tokenizer_type: CodeGenTokenizer
hub_model_id: rheumphi-sft
is_llama_derived_model: false
trust_remote_code: true

model_config:
  n_positions: 16384
  flash_attn: true
  flash_rotary: true

load_in_8bit: false
load_in_4bit: false
strict: false

datasets:
  - path: cmcmaster/rheum_and_general_sft
    type: sharegpt.load_ultrachat
    conversations: chatml
    field: messages

dataset_prepared_path:
val_set_size: 0.01
output_dir: ./phi2_sft_out

sequence_len: 2048
sample_packing: false  # currently unsupported
pad_to_sequence_len:

adapter:
lora_model_dir:
lora_r:
lora_alpha:
lora_dropout:
lora_target_linear:
lora_fan_in_fan_out:
lora_modules_to_save:

wandb_project: phi_rheum
wandb_entity:
wandb_watch:
wandb_name: pretrain_full
wandb_log_model:

gradient_accumulation_steps: 16
micro_batch_size: 1
num_epochs: 4
optimizer: adamw_torch
adam_beta2: 0.95
adam_epsilon: 0.00001
max_grad_norm: 1.0
lr_scheduler: cosine
learning_rate: 2e-5

train_on_inputs: false
group_by_length: false
bf16: true
fp16: false
tf32: true

gradient_checkpointing:
early_stopping_patience:
resume_from_checkpoint:
local_rank:
logging_steps: 1
xformers_attention:
flash_attention: true

warmup_steps: 100
evals_per_epoch: 4
saves_per_epoch: 1
debug:
deepspeed: deepspeed/zero2.json
weight_decay: 0.1
fsdp:
fsdp_config:
resize_token_embeddings_to_32x: true
special_tokens:
  pad_token: "<|endoftext|>"
  eos_token: "<|im_end|>"
hf_use_auth_token: true
chat_template: chatml
tokens:
  - "<|im_start|>"

```

</details><br>

# rheumphi-sft

This model is a fine-tuned version of [cmcmaster/rheumphi-pretrain](https://huggingface.co/cmcmaster/rheumphi-pretrain) on the None dataset.
It achieves the following results on the evaluation set:
- Loss: 0.7150

## 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: 2e-05
- train_batch_size: 1
- eval_batch_size: 1
- seed: 42
- distributed_type: multi-GPU
- num_devices: 4
- gradient_accumulation_steps: 16
- total_train_batch_size: 64
- total_eval_batch_size: 4
- optimizer: Adam with betas=(0.9,0.95) and epsilon=1e-05
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 100
- num_epochs: 4

### Training results

| Training Loss | Epoch | Step | Validation Loss |
|:-------------:|:-----:|:----:|:---------------:|
| 1.6349        | 0.0   | 1    | 1.3717          |
| 1.1517        | 0.25  | 54   | 0.9282          |
| 1.0438        | 0.5   | 108  | 0.8497          |
| 1.1125        | 0.75  | 162  | 0.7962          |
| 0.9667        | 1.0   | 216  | 0.7490          |
| 0.8973        | 1.25  | 270  | 0.7503          |
| 0.9262        | 1.5   | 324  | 0.7462          |
| 1.022         | 1.74  | 378  | 0.7530          |
| 0.9687        | 1.99  | 432  | 0.7376          |
| 1.0044        | 2.24  | 486  | 0.7287          |
| 0.9034        | 2.49  | 540  | 0.7333          |
| 1.0158        | 2.74  | 594  | 0.7228          |
| 0.8688        | 2.99  | 648  | 0.7167          |
| 0.9647        | 3.24  | 702  | 0.7176          |
| 0.9917        | 3.49  | 756  | 0.7170          |
| 0.9614        | 3.74  | 810  | 0.7146          |
| 1.0228        | 3.99  | 864  | 0.7150          |


### Framework versions

- Transformers 4.37.0.dev0
- Pytorch 2.0.1+cu117
- Datasets 2.16.1
- Tokenizers 0.15.0

{"license": "mit", "tags": ["axolotl", "generated_from_trainer"], "base_model": "cmcmaster/rheumphi-pretrain", "model-index": [{"name": "rheumphi-sft", "results": []}]}
transformers pytorch safetensors phi-msft text-generation axolotl generated_from_trainer conversational custom_code base_model:cmcmaster/rheumphi-pretrain license:mit autotrain_compatible endpoints_compatible has_space region:us