from modelscope import snapshot_download
from loguru import logger

def test_vllm():
    from utils.util_models import model_lan_vllm_qwen2_7b_instruct
    llm = model_lan_vllm_qwen2_7b_instruct()
    response = llm.invoke("今天天气怎么样？")
    logger.info(f"AI Message: {response.content}")

def test_download_model_modelscope(model_name: str = 'iic/VibeVoice-Realtime-0.5B', cache_dir: str = './models'):
    try:
        model_dir = snapshot_download(
            model_name,
            cache_dir=cache_dir
        )
        logger.info(f"模型 {model_name} 已下载到 {model_dir}")
        return model_dir
    except Exception as e:
        logger.error(f"下载模型 {model_name} 失败: {e}")
        return None