---
frameworks:
- Pytorch
license: Apache License 2.0
tasks:
- text-generation

#model-type:
##如 gpt、phi、llama、chatglm、baichuan 等
#- gpt

#domain:
##如 nlp、cv、audio、multi-modal
#- nlp

#language:
##语言代码列表 https://help.aliyun.com/document_detail/215387.html?spm=a2c4g.11186623.0.0.9f8d7467kni6Aa
#- cn 

#metrics:
##如 CIDEr、Blue、ROUGE 等
#- CIDEr

#tags:
##各种自定义，包括 pretrained、fine-tuned、instruction-tuned、RL-tuned 等训练方法和其他
#- pretrained

#tools:
##如 vllm、fastchat、llamacpp、AdaSeq 等
#- vllm
---
## Llama-3-8B-Agent
This Adapter is fine-tune from [meta-llama/Meta-Llama-3-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct) using [LLaMA-Factory](https://github.com/hiyouga/LLaMA-Factory)

### Environment
LLaMA-Factory Commit Version: **db7f3b9784d21ef5c18a11679ad995bb97d61f7c**

GPU RTX-4090 24G 单卡

Python 310

### Training hyperparameters
**Please ensure [FA2](https://github.com/Dao-AILab/flash-attention) installed**

```bash
CUDA_VISIBLE_DEVICES=0 python src/train_bash.py \
    --stage sft \
    --do_train \
    --model_name_or_path /data/models/Meta-Llama-3-8B-Instruct \
    --dataset alpaca_gpt4_zh,glaive_toolcall \
    --dataset_dir data \
    --template llama3 \
    --finetuning_type lora \
    --lora_target all \
    --output_dir saves/LLaMA3-8B/lora/sft \
    --overwrite_cache \
    --overwrite_output_dir \
    --cutoff_len 8192 \
    --preprocessing_num_workers 16 \
    --per_device_train_batch_size 1 \
    --per_device_eval_batch_size 2 \
    --gradient_accumulation_steps 8 \
    --lr_scheduler_type cosine \
    --logging_steps 10 \
    --warmup_steps 20 \
    --save_steps 1000 \
    --eval_steps 1000 \
    --max_samples 6000 \
    --evaluation_strategy steps \
    --load_best_model_at_end \
    --learning_rate 5e-6 \
    --num_train_epochs 3.0 \
    --val_size 0.1 \
    --plot_loss \
    --fp16 \
    --flash_attn
```

### training loss

![loss](training_loss.png)

### example
![example](example.png)