yitongl's picture
Add standalone inference helper for sfp4 checkpoint-700
1d0c0cc verified
raw
history blame contribute delete
758 Bytes
#!/bin/bash
set -euo pipefail
BUNDLE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
FASTVIDEO_ROOT="${FASTVIDEO_ROOT:-}"
if [[ -z "${FASTVIDEO_ROOT}" ]]; then
echo "FASTVIDEO_ROOT is not set."
echo "Set it to a FastVideo source checkout or installed package root, for example:"
echo " FASTVIDEO_ROOT=/path/to/FastVideo bash standalone_inference/run.sh"
exit 1
fi
python "${BUNDLE_ROOT}/install_overlay.py" --fastvideo-root "${FASTVIDEO_ROOT}"
export PYTHONPATH="${FASTVIDEO_ROOT}/fastvideo-kernel/python:${FASTVIDEO_ROOT}/fastvideo-kernel:${PYTHONPATH:-}"
export FASTVIDEO_ATTENTION_BACKEND=SPARSE_FP4_OURS_P_ATTN
export FASTVIDEO_SPARSE_FP4_USE_HIGH_PREC_O=1
cd "${FASTVIDEO_ROOT}"
python "${BUNDLE_ROOT}/run_inference.py" "$@"