from pathlib import Path
import sys

root = Path('/opt/ai-avatar-demo/models/qwen3-tts-12hz-1b7-base')
required = [
    'config.json',
    'generation_config.json',
    'model.safetensors',
    'tokenizer_config.json',
    'vocab.json',
    'merges.txt'
]

missing = []
for name in required:
    p = root / name
    exists = p.exists()
    size = p.stat().st_size if exists else 'NA'
    print(name, 'exists=', exists, 'size=', size)
    if not exists or size == 0:
        missing.append(name)

if missing:
    print('BLOCKED_MISSING_REQUIRED_FILES', missing)
    sys.exit(1)
else:
    print('ALL_REQUIRED_FILES_OK')
