code-Psi0-yth-v21 / scripts /deploy /serve_psi0-rtc-sonic.sh
Tinghong-Ye22's picture
Add files using upload-large-folder tool
c4f8e4a verified
Raw History Blame Contribute Delete
2.03 kB
pkill -f monitor.py
cd /cpfs01/thscc/sharestorage/AIGC-06-01/Hithink_VideoGen_Group/user_workspace/yetinghong/code/Psi0-yth-v18
source /cpfs01/thscc/sharestorage/AIGC-06-01/Hithink_VideoGen_Group/user_workspace/yetinghong/code/Psi0-yth-v15/.venv-psi/bin/activate
[ -f .env ] && source .env
export PYTHONPATH=/cpfs01/thscc/sharestorage/AIGC-06-01/Hithink_VideoGen_Group/user_workspace/yetinghong/code/Psi0-yth-v18/src
export CUDA_VISIBLE_DEVICES=0
echo "Serving with CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES"
CHECKPOINT_DIR=${CHECKPOINT_DIR:-/cpfs01/thscc/sharestorage/AIGC-06-01/Hithink_VideoGen_Group/user_workspace/yetinghong/code/Psi0-yth-v18/runs/posttrain_v1_trimodal/posttrain.sg.flow1000.cwml.lr1.0e-04.b256.gpus8.2606041200}
CHECKPOINT_STEP=${CHECKPOINT_STEP:-best}
SEGMENT_SWITCH_MODE=rtc_tail
export PSI0_SEGMENT_SWITCH_MODE=$SEGMENT_SWITCH_MODE
export PSI0_DEPLOY_INPUT_MODE=video_clip
export PSI0_VIDEO_FULL_CACHE=${PSI0_VIDEO_FULL_CACHE:-1}
export PSI0_VIDEO_FULL_CACHE_SIZE=${PSI0_VIDEO_FULL_CACHE_SIZE:-2}
export PSI0_VIDEO_CLIP_CACHE_SIZE=${PSI0_VIDEO_CLIP_CACHE_SIZE:-64}
echo "Video cache: full=$PSI0_VIDEO_FULL_CACHE full_size=$PSI0_VIDEO_FULL_CACHE_SIZE clip_size=$PSI0_VIDEO_CLIP_CACHE_SIZE"
if [ ! -d "$CHECKPOINT_DIR" ]; then
echo "ERROR: CHECKPOINT_DIR does not exist: $CHECKPOINT_DIR"
exit 1
fi
if [ "$CHECKPOINT_STEP" = "best" ] || [ "$CHECKPOINT_STEP" = "best_ckpt" ]; then
if [ ! -d "$CHECKPOINT_DIR/checkpoints/best_ckpt" ]; then
echo "ERROR: best_ckpt does not exist: $CHECKPOINT_DIR/checkpoints/best_ckpt"
exit 1
fi
elif [ ! -d "$CHECKPOINT_DIR/checkpoints/ckpt_$CHECKPOINT_STEP" ] && [ ! -d "$CHECKPOINT_DIR/ckpt_$CHECKPOINT_STEP" ]; then
echo "ERROR: ckpt_$CHECKPOINT_STEP does not exist under: $CHECKPOINT_DIR"
exit 1
fi
python src/psi/deploy/psi_serve_rtc-trainingtimertc-sonic.py \
--host 0.0.0.0 \
--port 8014 \
--action_exec_horizon 20 \
--policy psi \
--rtc \
--run-dir=$CHECKPOINT_DIR \
--ckpt-step=$CHECKPOINT_STEP