HeZ/phi-3-mini-4k-ft-code-gen-v2
Browse files- README.md +37 -47
- adapter_config.json +11 -4
- adapter_model.safetensors +1 -1
- tokenizer.json +6 -1
- training_args.bin +2 -2
README.md
CHANGED
|
@@ -1,67 +1,57 @@
|
|
| 1 |
---
|
| 2 |
base_model: microsoft/Phi-3-mini-4k-instruct
|
| 3 |
-
library_name:
|
| 4 |
-
|
| 5 |
tags:
|
|
|
|
| 6 |
- trl
|
| 7 |
- sft
|
| 8 |
-
|
| 9 |
-
model-index:
|
| 10 |
-
- name: phi-3-mini-LoRA
|
| 11 |
-
results: []
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
| 15 |
-
should probably proofread and complete it, then remove this comment. -->
|
| 16 |
-
|
| 17 |
-
# phi-3-mini-LoRA
|
| 18 |
-
|
| 19 |
-
This model is a fine-tuned version of [microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct) on an unknown dataset.
|
| 20 |
-
It achieves the following results on the evaluation set:
|
| 21 |
-
- Loss: 0.5759
|
| 22 |
-
|
| 23 |
-
## Model description
|
| 24 |
|
| 25 |
-
|
|
|
|
| 26 |
|
| 27 |
-
##
|
| 28 |
|
| 29 |
-
|
|
|
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
| 34 |
|
| 35 |
## Training procedure
|
| 36 |
|
| 37 |
-
|
|
|
|
|
|
|
| 38 |
|
| 39 |
-
|
| 40 |
-
- learning_rate: 0.0001
|
| 41 |
-
- train_batch_size: 1
|
| 42 |
-
- eval_batch_size: 1
|
| 43 |
-
- seed: 42
|
| 44 |
-
- gradient_accumulation_steps: 40
|
| 45 |
-
- total_train_batch_size: 40
|
| 46 |
-
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
| 47 |
-
- lr_scheduler_type: linear
|
| 48 |
-
- lr_scheduler_warmup_ratio: 0.1
|
| 49 |
-
- num_epochs: 1
|
| 50 |
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
-
|
| 54 |
-
|:-------------:|:------:|:----:|:---------------:|
|
| 55 |
-
| 0.7817 | 0.2262 | 100 | 0.5929 |
|
| 56 |
-
| 0.5969 | 0.4525 | 200 | 0.5816 |
|
| 57 |
-
| 0.5848 | 0.6787 | 300 | 0.5775 |
|
| 58 |
-
| 0.581 | 0.9049 | 400 | 0.5759 |
|
| 59 |
|
| 60 |
|
| 61 |
-
### Framework versions
|
| 62 |
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
base_model: microsoft/Phi-3-mini-4k-instruct
|
| 3 |
+
library_name: transformers
|
| 4 |
+
model_name: phi-3-mini-LoRA
|
| 5 |
tags:
|
| 6 |
+
- generated_from_trainer
|
| 7 |
- trl
|
| 8 |
- sft
|
| 9 |
+
licence: license
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Model Card for phi-3-mini-LoRA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
This model is a fine-tuned version of [microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct).
|
| 15 |
+
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 16 |
|
| 17 |
+
## Quick start
|
| 18 |
|
| 19 |
+
```python
|
| 20 |
+
from transformers import pipeline
|
| 21 |
|
| 22 |
+
question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
|
| 23 |
+
generator = pipeline("text-generation", model="HeZ/phi-3-mini-LoRA", device="cuda")
|
| 24 |
+
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 25 |
+
print(output["generated_text"])
|
| 26 |
+
```
|
| 27 |
|
| 28 |
## Training procedure
|
| 29 |
|
| 30 |
+
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/hezhang33/Phi3-mini-ft-python-code/runs/sggnnts3)
|
| 31 |
+
|
| 32 |
+
This model was trained with SFT.
|
| 33 |
|
| 34 |
+
### Framework versions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
+
- TRL: 0.12.2
|
| 37 |
+
- Transformers: 4.46.3
|
| 38 |
+
- Pytorch: 2.7.1
|
| 39 |
+
- Datasets: 4.0.0
|
| 40 |
+
- Tokenizers: 0.20.3
|
| 41 |
|
| 42 |
+
## Citations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
|
|
|
|
| 45 |
|
| 46 |
+
Cite TRL as:
|
| 47 |
+
|
| 48 |
+
```bibtex
|
| 49 |
+
@misc{vonwerra2022trl,
|
| 50 |
+
title = {{TRL: Transformer Reinforcement Learning}},
|
| 51 |
+
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallouédec},
|
| 52 |
+
year = 2020,
|
| 53 |
+
journal = {GitHub repository},
|
| 54 |
+
publisher = {GitHub},
|
| 55 |
+
howpublished = {\url{https://github.com/huggingface/trl}}
|
| 56 |
+
}
|
| 57 |
+
```
|
adapter_config.json
CHANGED
|
@@ -3,6 +3,9 @@
|
|
| 3 |
"auto_mapping": null,
|
| 4 |
"base_model_name_or_path": "microsoft/Phi-3-mini-4k-instruct",
|
| 5 |
"bias": "none",
|
|
|
|
|
|
|
|
|
|
| 6 |
"fan_in_fan_out": false,
|
| 7 |
"inference_mode": true,
|
| 8 |
"init_lora_weights": true,
|
|
@@ -11,24 +14,28 @@
|
|
| 11 |
"layers_to_transform": null,
|
| 12 |
"loftq_config": {},
|
| 13 |
"lora_alpha": 16,
|
|
|
|
| 14 |
"lora_dropout": 0.05,
|
| 15 |
"megatron_config": null,
|
| 16 |
"megatron_core": "megatron.core",
|
| 17 |
"modules_to_save": null,
|
| 18 |
"peft_type": "LORA",
|
|
|
|
| 19 |
"r": 16,
|
| 20 |
"rank_pattern": {},
|
| 21 |
"revision": null,
|
| 22 |
"target_modules": [
|
| 23 |
-
"
|
|
|
|
|
|
|
| 24 |
"v_proj",
|
| 25 |
"gate_proj",
|
| 26 |
-
"o_proj",
|
| 27 |
"k_proj",
|
| 28 |
-
"
|
| 29 |
-
"down_proj"
|
| 30 |
],
|
| 31 |
"task_type": "CAUSAL_LM",
|
|
|
|
| 32 |
"use_dora": false,
|
|
|
|
| 33 |
"use_rslora": false
|
| 34 |
}
|
|
|
|
| 3 |
"auto_mapping": null,
|
| 4 |
"base_model_name_or_path": "microsoft/Phi-3-mini-4k-instruct",
|
| 5 |
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
"fan_in_fan_out": false,
|
| 10 |
"inference_mode": true,
|
| 11 |
"init_lora_weights": true,
|
|
|
|
| 14 |
"layers_to_transform": null,
|
| 15 |
"loftq_config": {},
|
| 16 |
"lora_alpha": 16,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
"lora_dropout": 0.05,
|
| 19 |
"megatron_config": null,
|
| 20 |
"megatron_core": "megatron.core",
|
| 21 |
"modules_to_save": null,
|
| 22 |
"peft_type": "LORA",
|
| 23 |
+
"qalora_group_size": 16,
|
| 24 |
"r": 16,
|
| 25 |
"rank_pattern": {},
|
| 26 |
"revision": null,
|
| 27 |
"target_modules": [
|
| 28 |
+
"down_proj",
|
| 29 |
+
"o_proj",
|
| 30 |
+
"up_proj",
|
| 31 |
"v_proj",
|
| 32 |
"gate_proj",
|
|
|
|
| 33 |
"k_proj",
|
| 34 |
+
"q_proj"
|
|
|
|
| 35 |
],
|
| 36 |
"task_type": "CAUSAL_LM",
|
| 37 |
+
"trainable_token_indices": null,
|
| 38 |
"use_dora": false,
|
| 39 |
+
"use_qalora": false,
|
| 40 |
"use_rslora": false
|
| 41 |
}
|
adapter_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 35668592
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dd3f25cd467e644f3e8cd13b8f3bbd0aea947bec687a881549b03112b8863f21
|
| 3 |
size 35668592
|
tokenizer.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
-
"truncation":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
"padding": null,
|
| 5 |
"added_tokens": [
|
| 6 |
{
|
|
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
+
"truncation": {
|
| 4 |
+
"direction": "Right",
|
| 5 |
+
"max_length": 512,
|
| 6 |
+
"strategy": "LongestFirst",
|
| 7 |
+
"stride": 0
|
| 8 |
+
},
|
| 9 |
"padding": null,
|
| 10 |
"added_tokens": [
|
| 11 |
{
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:54eb70c6f1ba331a040983c06f83efb1f0c65788b5e67e63fba82ca37d395d7b
|
| 3 |
+
size 5969
|