Files
icassp2027-experiment/run_smoke_easycom_direct.sh

67 lines
2.3 KiB
Bash

#!/usr/bin/env bash
# Smoke: one EasyCom session on one GPU via streaming_turn_model_directly.py
#
# Short smoke (default): --end only, NO --target
# (passing both requires --end == full target duration)
# Full session: END= (empty) and --target is used
set -euo pipefail
# Remote defaults (override as needed)
PROJECT_ROOT="${PROJECT_ROOT:-/data1/yfzx/wangx/Code/icassp2027-experiment}"
MODEL="${MODEL:-/data1/yfzx/wangx/Models/Qwen2.5-Omni-3B}"
VIDEO_ROOT="${VIDEO_ROOT:-/data1/yfzx/wangx/Datasets/easycom/extracted_easycom/Main/Video_Compressed}"
TARGET_ROOT="${TARGET_ROOT:-/data1/yfzx/wangx/Datasets/easycom/target_frame}"
FEATURE_ROOT="${FEATURE_ROOT:-${PROJECT_ROOT}/features/easycom_direct_smoke}"
LOG_ROOT="${LOG_ROOT:-${PROJECT_ROOT}/logs/easycom_direct_smoke}"
SESSION_ID="${SESSION_ID:-1}"
GPU="${GPU:-0}"
# Short smoke: END=4. Full session smoke: END="" (empty).
END="${END:-4}"
MEMORY_SECONDS="${MEMORY_SECONDS:-20}"
VIDEO_FPS="${VIDEO_FPS:-2}"
session="Session_${SESSION_ID}"
session_dir="${VIDEO_ROOT}/${session}"
target="${TARGET_ROOT}/${session}.npy"
output="${FEATURE_ROOT}/${session}_gpu${GPU}.pt"
log="${LOG_ROOT}/${session}_gpu${GPU}.log"
mkdir -p "${FEATURE_ROOT}" "${LOG_ROOT}"
cd "${PROJECT_ROOT}"
[[ -d "${session_dir}" ]] || { echo "Missing: ${session_dir}" >&2; exit 1; }
extra_args=()
if [[ -n "${END}" ]]; then
# Bounded smoke: do not pass --target (length would conflict with --end).
extra_args+=(--end "${END}")
MEMORY_SECONDS=0
else
[[ -s "${target}" ]] || { echo "Missing: ${target}" >&2; exit 1; }
extra_args+=(--target "${target}")
fi
echo "GPU=${GPU} session=${session} end=${END:-full} memory=${MEMORY_SECONDS}"
echo "log -> ${log}"
{
echo "$(date): smoke start ${session} on GPU ${GPU}"
CUDA_VISIBLE_DEVICES="${GPU}" PYTHONUNBUFFERED=1 \
python streaming_turn_model_directly.py \
--model-id "${MODEL}" \
--easycom-session-dir "${session_dir}" \
--use-audio-in-video \
--mode open-stream-replay \
--memory-seconds "${MEMORY_SECONDS}" \
--video-fps "${VIDEO_FPS}" \
--dtype bfloat16 \
--flash-attention-2 \
--device cuda:0 \
--verify-every 5 \
--verify-continuous-every 5 \
"${extra_args[@]}" \
--output "${output}"
echo "$(date): smoke done -> ${output}"
} 2>&1 | tee "${log}"