> 技术文档 > llamafactory微调过程中报错TypeError: argument of type ‘NoneType‘ is not iterable_typeerror: argument of type \'nonetype\' is not iter

llamafactory微调过程中报错TypeError: argument of type ‘NoneType‘ is not iterable_typeerror: argument of type \'nonetype\' is not iter


项目场景:

llamafactory微调过程中,更新transformers版本后无法微调成功

问题描述

进入llamafactory的ui界面,点击微调后报错
if v not in ALL_PARALLEL_STYLES: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type \'NoneType\' is not iterable


解决方案:

修改路径LLaMA-Factory/src/llamafactory/cli.py下的cli.py文件,在开头添加如下内容:

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

完成后即可继续微调

免费商用字体下载