File size: 1,358 Bytes
21e9f42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash

export HF_PROJECT="gpt2-medium-dutch-nedd-2"

# Variables for training the tokenizer and creating the config
export VOCAB_SIZE="50257"
export DATASET="${HOME}/data/nedd_wiki_news/nedd_wiki_news.py" # Name of the dataset in the Huggingface Hub
export DATASET_CONFIG="ddwn500_nl" # Config of the dataset in the Huggingface Hub
export DATASET_SPLIT="train" # Split to use for training tokenizer and model
export TEXT_FIELD="text" # Field containing the text to be used for training
export CONFIG_TYPE="gpt2-medium" # Config that our model will use
export MODEL_PATH="${HOME}/data/${HF_PROJECT}" # Path to the model, e.g. here inside the mount

python run_clm_flax.py \
    --output_dir="${MODEL_PATH}" \
    --model_type="gpt2" \
    --config_name="${MODEL_PATH}" \
    --tokenizer_name="${MODEL_PATH}" \
    --preprocessing_num_workers="96" \
    --do_train --do_eval \
    --dataset_name="${DATASET}" \
    --dataset_config_name="${DATASET_CONFIG}" \
    --block_size="512" \
    --per_device_train_batch_size="16" \
    --per_device_eval_batch_size="16" \
    --learning_rate="0.0024" --warmup_steps="5000" \
    --adam_beta1="0.9" --adam_beta2="0.98" --weight_decay="0.01" \
    --overwrite_output_dir \
    --num_train_epochs="1" \
    --logging_steps="500" \
    --save_steps="40000" \
    --eval_steps="2500"
    
#     \
#    --push_to_hub