Skip to content

Commit

Permalink
feat: add HuggingFace - AutoTrain
Browse files Browse the repository at this point in the history
  • Loading branch information
katopz committed Oct 1, 2023
1 parent 07eaebe commit 26f6b3e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
1 change: 1 addition & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@
- [Large Language Model](ml/large-language-model.md)
- [Stable Diffusion](ml/stable-diffusion.md)
- [Hugging Face - Candle](ml/huggingface-candle.md)
- [Hugging Face - AutoTrain](ml/huggingface-autotrain.md)
- [Bye](bye.md)
36 changes: 19 additions & 17 deletions src/ml/huggingface-autotrain.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## HuggingFace Auto train
## 🤗 HuggingFace - AutoTrain

### Knowledge Base
### 📚 Knowledge Base

- `PEFT` Parameter-Efficient Fine-Tuning: https://github.com/huggingface/peft
- `TRL` Transformer Reinforcement Learning: https://github.com/huggingface/trl
- `PEFT` [Parameter-Efficient Fine-Tuning](https://github.com/huggingface/peft)
- `TRL` [Transformer Reinforcement Learning](https://github.com/huggingface/trl)

> ref: https://github.com/huggingface/trl/blob/main/examples/README.md
### Setup
### ⚙️ Setup

```bash
# Install Python3 pip
Expand All @@ -30,7 +30,7 @@ pip3 install deepspeed
pip install accelerate
```

### Config
### 📝 Config

```bash
accelerate config
Expand Down Expand Up @@ -99,7 +99,9 @@ bf16
accelerate configuration saved at /home/katopz/.cache/huggingface/accelerate/default_config.yaml
```
### Fine-tuned
### 🪛 Fine tune
![](/assets/kat.png) <span class="speech-bubble">Let's fine-tune [Mistral](https://mistral.ai/) locally.</span>
```bash
# Setup
Expand All @@ -110,17 +112,17 @@ autotrain llm --help
# Fine tune
autotrain llm \
--train \
--model mistralai/Mistral-7B-Instruct-v0.1 \
--data-path $DATA_PATH \
--use-peft \
--use-int4 \
--lr 20-4 \
--batch-size 4 \
--epochs 1 \
--model mistralai/Mistral-7B-Instruct-v0.1 \
--data-path $DATA_PATH \
--use-peft\
--use-int4\
--lr 2e-4 \
--batch-size 4 \
--epochs 1 \
--trainer sft \
--username $USERNAME \
--username $USER_NAME \
--token $HF_TOKEN \
--project-name foo-bar \
--target-modules q_proj,v_proj \
--project-name $PROJECT_NAME \
--target-modules q_proj,v_proj \
--push-to-hub
```
2 changes: 1 addition & 1 deletion src/ml/huggingface-candle.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Hugging Face - Candle
# 🤗 HuggingFace - Candle

> [https://github.com/huggingface/candle]()
Expand Down

0 comments on commit 26f6b3e

Please sign in to comment.