#!/bin/bash
# 启动 MuseTalk 常驻推理服务
# 端口: 8011, GPU: 从 backend/.env 读取 MUSETALK_GPU_ID (默认 GPU0)

cd "$(dirname "$0")/models/MuseTalk"

# 请根据您的 Miniconda/Anaconda 安装路径修改此处
PYTHON_PATH="/home/rongye/ProgramFiles/miniconda3/envs/musetalk/bin/python"

if [ -f "$PYTHON_PATH" ]; then
    "$PYTHON_PATH" scripts/server.py
else
    echo "❌ 错误: 找不到 Python 解释器: $PYTHON_PATH"
    echo "请编辑此脚本 (run_musetalk.sh) 修改 PYTHON_PATH 为您的实际路径:"
    echo "conda activate musetalk && which python"
    exit 1
fi
