import inspect
import qwen_tts
from pathlib import Path

source = '/opt/ai-avatar-demo/services/tts/.venv/lib/python3.12/site-packages/qwen_tts/inference/qwen3_tts_model.py'
print('qwen_tts_file=', getattr(qwen_tts, '__file__', None))
Model = getattr(qwen_tts, 'Qwen3TTSModel', None)
Tokenizer = getattr(qwen_tts, 'Qwen3TTSTokenizer', None)
print('Qwen3TTSModel_exists=', Model is not None)
print('Qwen3TTSTokenizer_exists=', Tokenizer is not None)
if Model is not None:
    print('Qwen3TTSModel_sig=', inspect.signature(Model))

try:
    lines = Path(source).read_text(encoding='utf-8').splitlines()
    for i in range(460, 570):
        if i <= len(lines):
            line = lines[i-1]
            if 'def generate_voice_clone' in line or 'tts_model_type' in line or 'ref_audio' in line or 'ref_text' in line or 'language' in line:
                print(f'{i}: {line}')
except Exception as e:
    print("Source read error:", e)

print('NO_MODEL_LOAD_EXECUTED')
print('NO_TTS_GENERATION_EXECUTED')
