Improved dependency management and checkpoint handling
This commit is contained in:
+15
-5
@@ -3,24 +3,34 @@
|
||||
set -e
|
||||
|
||||
CKPT_DIR="/piper/lightning_logs"
|
||||
CKPT=""
|
||||
VOICE_NAME=${VOICE_NAME:-pt_BR-well}
|
||||
|
||||
latest_checkpoint() {
|
||||
ls -t ${CKPT_DIR}/version_*/checkpoints/*.ckpt | head -n1
|
||||
}
|
||||
|
||||
if compgen -G "${CKPT_DIR}/version_*/checkpoints/*.ckpt" > /dev/null; then
|
||||
CKPT=$(ls -t ${CKPT_DIR}/version_*/checkpoints/*.ckpt | head -n1)
|
||||
CKPT=$(latest_checkpoint)
|
||||
RESUME_ARG="--ckpt_path $CKPT"
|
||||
|
||||
echo "Resuming: $CKPT"
|
||||
fi
|
||||
|
||||
exec python3 -m piper.train fit \
|
||||
--data.voice_name pt_BR-well \
|
||||
python3 -m piper.train fit \
|
||||
--data.voice_name $VOICE_NAME \
|
||||
--data.espeak_voice pt-br \
|
||||
--data.audio_dir /data/wav/ \
|
||||
--data.batch_size 16 \
|
||||
--data.cache_dir /data/.cache/ \
|
||||
--data.config_path /data/config.json \
|
||||
--data.config_path /data/${VOICE_NAME}-medium.onnx.json \
|
||||
--data.csv_path /data/metadata.csv \
|
||||
--model.sample_rate 22050 \
|
||||
--trainer.check_val_every_n_epoch 1 \
|
||||
--trainer.max_epochs 10000 \
|
||||
$RESUME_ARG
|
||||
|
||||
CKPT=$(latest_checkpoint)
|
||||
|
||||
python3 -m piper.train.export_onnx \
|
||||
--checkpoint $CKPT \
|
||||
--output-file /data/${VOICE_NAME}-medium.onnx
|
||||
|
||||
Reference in New Issue
Block a user