Hunyuan-Avatar / scripts /run_gradio.sh
rahul7star's picture
Update scripts/run_gradio.sh
5aef126 verified
raw
history blame
1.16 kB
#!/bin/bash
JOBS_DIR=$(dirname $(dirname "$0"))
export PYTHONPATH=./
export MODEL_BASE=./weights
MODEL_DIR=${MODEL_BASE}/ckpts/hunyuan-video-t2v-720p
# Step 1: Download model files from HF using Python
echo "Downloading model from tencent/HunyuanVideo-Avatar to $MODEL_DIR"
python3 - <<EOF
from huggingface_hub import snapshot_download
import os
target_dir = "${MODEL_DIR}"
os.makedirs(target_dir, exist_ok=True)
# Download model snapshot
snapshot_download(repo_id="tencent/HunyuanVideo-Avatar",
local_dir=target_dir,
local_dir_use_symlinks=False,
ignore_patterns=["*.safetensors"]) # Optional: skip very large files if not needed
EOF
# Step 2: Run your scripts
checkpoint_path=${MODEL_DIR}/transformers/mp_rank_00_model_states.pt
torchrun --nnodes=1 --nproc_per_node=8 --master_port 29605 hymm_gradio/flask_audio.py \
--input 'assets/test.csv' \
--ckpt ${checkpoint_path} \
--sample-n-frames 129 \
--seed 128 \
--image-size 704 \
--cfg-scale 7.5 \
--infer-steps 50 \
--use-deepcache 1 \
--flow-shift-eval-video 5.0 &
python3 hymm_gradio/gradio_audio.py