在部署已经 merge 好的模型时,sh 脚本: 

RAY_memory_monitor_refresh_ms=0 
CUDA_VISIBLE_DEVICES=0
swift deploy \
    --model ./merged_model 

报错: TypeError: argument of type 'NoneType' is not iterable


解决方法:找到 deploy.py

在文件开头加上如下的几行代码: 

from transformers import modeling_utils
if not hasattr(modeling_utils, "ALL_PARALLEL_STYLES") or modeling_utils.ALL_PARALLEL_STYLES is None:
    modeling_utils.ALL_PARALLEL_STYLES = ["tp", "none","colwise",'rowwise']

修改后如图: 

再次运行,就不会报这个错误啦! 

Logo

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

更多推荐