import re
import pathlib

p = pathlib.Path("/opt/ai-avatar-demo/work/gate7m_a_qwen3_tts_customvoice_smoke.py")
if not p.exists():
    print("Script does not exist!")
    exit(0)

keywords = [
    "generate_voice_clone",
    "generate_custom_voice",
    "MODEL_ROOT",
    "tts_model_type"
]

try:
    with open(p, "r", encoding="utf-8") as f:
        lines = f.readlines()
    for idx, line in enumerate(lines):
        match = False
        for kw in keywords:
            if kw in line:
                match = True
                break
        if match:
            print(f"{idx+1}: {line.strip()}")
except Exception as e:
    print("Error:", e)
