报错:TypeError: scaled_dot_product_attention(): argument 'is_causal' must be bool, not Tensor

解决方法: 

from whisper.model import disable_sdpa

if __name__ == '__main__':
    with disable_sdpa():
        main()

这是 Sherpa-onnx 项目提供的解决方案,通过上下文管理器临时禁用 scaled_dot_product_attention(SDPA) 功能,使用传统的注意力实现来避免类型问题。

Logo

中国智能体开发者社区,聚焦智能体与大模型开发,提供前沿资讯、实用工具链、开源项目及行业案例。通过技术沙龙、开发者大赛等活动,促进经验交流与协作,助力开发者快速构建创新智能应用。

更多推荐