|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set -a |
|
source ~/.env |
|
set +a |
|
|
|
module load python/3.7.4 |
|
module load gitlfs/2.7.1 |
|
source $FP_BIGS/env_lang_mod/bin/activate |
|
|
|
|
|
huggingface-cli login <<EOF |
|
yongzx |
|
Y0ngzh3ngx!nHF |
|
EOF |
|
|
|
|
|
MODEL="gpt2-finetuned-oscar-fr-ori-tok" |
|
|
|
if [ -d "/users/zyong2/data/zyong2/bigscience/gh/$MODEL" ] |
|
then |
|
echo "Directory /users/zyong2/data/zyong2/bigscience/gh/$MODEL exists." |
|
else |
|
cd /users/zyong2/data/zyong2/bigscience/gh/ |
|
hf_dir="https://huggingface.co/yongzx/$MODEL" |
|
echo $hf_dir |
|
git clone $hf_dir |
|
fi |
|
|
|
|
|
cd /users/zyong2/data/zyong2/bigscience/gh/$MODEL |
|
|
|
|
|
ORIGINAL_MODEL_DIR="/users/zyong2/data/zyong2/bigscience/data/processed/exp-001/ft-gpt2-no-tok" |
|
for CHECKPOINT in {500..76500..500} |
|
do |
|
git checkout main |
|
exists=`git show-ref refs/heads/checkpoint-$CHECKPOINT` |
|
if [ -n "$exists" ]; |
|
then |
|
git checkout "checkpoint-$CHECKPOINT" |
|
else |
|
git checkout -b "checkpoint-$CHECKPOINT" |
|
fi |
|
git status |
|
git pull origin "checkpoint-$CHECKPOINT" |
|
echo "๐ Copying from folder ${ORIGINAL_MODEL_DIR}/checkpoint-${CHECKPOINT}" |
|
cp "${ORIGINAL_MODEL_DIR}/checkpoint-${CHECKPOINT}/config.json" ./ |
|
cp "${ORIGINAL_MODEL_DIR}/checkpoint-${CHECKPOINT}/merges.txt" ./ |
|
cp "${ORIGINAL_MODEL_DIR}/checkpoint-${CHECKPOINT}/pytorch_model.bin" ./ |
|
cp "${ORIGINAL_MODEL_DIR}/checkpoint-${CHECKPOINT}/special_tokens_map.json" ./ |
|
cp "${ORIGINAL_MODEL_DIR}/checkpoint-${CHECKPOINT}/tokenizer.json" ./ |
|
cp "${ORIGINAL_MODEL_DIR}/checkpoint-${CHECKPOINT}/tokenizer_config.json" ./ |
|
cp "${ORIGINAL_MODEL_DIR}/checkpoint-${CHECKPOINT}/training_args.bin" ./ |
|
cp "${ORIGINAL_MODEL_DIR}/checkpoint-${CHECKPOINT}/vocab.json" ./ |
|
git status |
|
git add . && git commit -m "checkpoint $CHECKPOINT" |
|
git push origin "checkpoint-$CHECKPOINT" |
|
echo "=============================================================================================" |
|
done |
|
|
|
|
|
|