Commit
·
ed90d34
1
Parent(s):
04db925
simplify
Browse files- Dockerfile +0 -6
- configs/Qwen3-4B-Base_a10g-small.yaml +0 -43
- requirements.txt +2 -2
- sft.py +0 -24
Dockerfile
CHANGED
@@ -18,12 +18,6 @@ COPY . .
|
|
18 |
RUN pip install --upgrade pip && \
|
19 |
pip install --no-cache-dir -r requirements.txt
|
20 |
|
21 |
-
# Make script executable and move it to PATH
|
22 |
-
RUN install -m 755 sft.py /usr/local/bin/sft
|
23 |
-
|
24 |
-
# Set environment variable for Hugging Face cache
|
25 |
-
# ENV HF_HOME=/usr/src/app/.cache/huggingface
|
26 |
-
|
27 |
# Make /usr/src/app/ a writable directory
|
28 |
RUN chmod -R 777 $HOME
|
29 |
|
|
|
18 |
RUN pip install --upgrade pip && \
|
19 |
pip install --no-cache-dir -r requirements.txt
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
# Make /usr/src/app/ a writable directory
|
22 |
RUN chmod -R 777 $HOME
|
23 |
|
configs/Qwen3-4B-Base_a10g-small.yaml
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
# Model arguments
|
2 |
-
model_name_or_path: Qwen/Qwen2.5-1.5B
|
3 |
-
model_revision: main
|
4 |
-
torch_dtype: bfloat16
|
5 |
-
|
6 |
-
# Data training arguments
|
7 |
-
dataset_name: trl-lib/tldr
|
8 |
-
dataset_num_proc: 4
|
9 |
-
|
10 |
-
# SFT trainer config
|
11 |
-
bf16: true
|
12 |
-
do_eval: false
|
13 |
-
eval_strategy: 'no'
|
14 |
-
gradient_accumulation_steps: 8
|
15 |
-
gradient_checkpointing: true
|
16 |
-
gradient_checkpointing_kwargs:
|
17 |
-
use_reentrant: false
|
18 |
-
# hub_model_id: open-r1/OlympicCoder-7B
|
19 |
-
hub_strategy: every_save
|
20 |
-
learning_rate: 1.0e-05
|
21 |
-
log_level: info
|
22 |
-
logging_steps: 1
|
23 |
-
logging_strategy: steps
|
24 |
-
lr_scheduler_type: cosine_with_min_lr
|
25 |
-
lr_scheduler_kwargs:
|
26 |
-
min_lr_rate: 0.1
|
27 |
-
packing: false
|
28 |
-
max_grad_norm: 0.2
|
29 |
-
max_length: 512
|
30 |
-
max_steps: -1
|
31 |
-
num_train_epochs: 10
|
32 |
-
output_dir: data/Qwen2.5-0.5B-SFT
|
33 |
-
overwrite_output_dir: true
|
34 |
-
per_device_eval_batch_size: 1
|
35 |
-
per_device_train_batch_size: 2
|
36 |
-
push_to_hub: true
|
37 |
-
report_to:
|
38 |
-
- wandb
|
39 |
-
save_strategy: epoch
|
40 |
-
save_total_limit: 1
|
41 |
-
seed: 42
|
42 |
-
use_liger_kernel: true
|
43 |
-
warmup_ratio: 0.03
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
git+https://github.com/huggingface/trl.git@main#egg=trl
|
2 |
-
|
3 |
-
|
|
|
1 |
git+https://github.com/huggingface/trl.git@main#egg=trl
|
2 |
+
liger-kernel
|
3 |
+
gradio
|
sft.py
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
#!/usr/bin/env python3
|
2 |
-
import argparse
|
3 |
-
import subprocess
|
4 |
-
import os
|
5 |
-
|
6 |
-
parser = argparse.ArgumentParser(description="Demo script for the model.")
|
7 |
-
|
8 |
-
parser.add_argument("--model", type=str)
|
9 |
-
parser.add_argument("--dataset", type=str)
|
10 |
-
parser.add_argument("--flavor", type=str)
|
11 |
-
parser.add_argument("--token", type=str)
|
12 |
-
|
13 |
-
# Parse the command line arguments
|
14 |
-
args = parser.parse_args()
|
15 |
-
|
16 |
-
# Get the config file based on the model and flavor
|
17 |
-
config_file = f"configs/{args.model}_{args.flavor}.yaml"
|
18 |
-
|
19 |
-
# Check if the config file exists
|
20 |
-
if not os.path.exists(config_file):
|
21 |
-
raise RuntimeError(f"Training model {args.model} with flavor {args.flavor} is not supported.")
|
22 |
-
|
23 |
-
# Run another Python script
|
24 |
-
subprocess.run(["trl", "sft", "--config", config_file, "--dataset_name", args.dataset])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|