AI开发平台MODELARTS-tokenizer文件修改:Llama-Factory
时间:2025-12-15 17:54:45
Llama-Factory
- glm4-9b模型
在训练开始前,需要修改glm4-9b模型中的tokenizer文件modeling_chatglm.py内容,具体步骤如下:
进入到tokenizer(权重)目录下,修改modeling_chatglm.py文件内容。vim modeling_chatglm.py # 注释掉以下两行内容 # if attention_mask is not None # attention_mask = ~attention_mask样例图:

- InternVL2_5系列模型
InternVL2_5系列模型均未在Transformers仓注册,需提前手动打patch,详细步骤如下:
- InternVL2_5-8B:
# git clone 方式下载模型文件,如果已下载忽略此git clone步骤 git clone https://huggingface.co/OpenGVLab/InternVL2_5-8B # 进入权重目录下打patch文件,${work_dir}为工作目录根据实际修改 cd InternVL2_5-8B && git apply ${work_dir}/llm_train/AscendFactory/third-party/internvl25-8b.patch
- InternVL2_5-38B:
# git clone 方式下载模型文件,如果已下载忽略此git clone步骤 git clone https://huggingface.co/OpenGVLab/InternVL2_5-38B # 进入权重目录下打patch文件,${work_dir}为工作目录根据实际修改 cd InternVL2_5-38B && git apply ${work_dir}/llm_train/AscendFactory/third-party/internvl25-38b.patch
- InternVL2_5-78B:
# git clone 方式下载模型文件,如果已下载忽略此git clone步骤 git clone https://huggingface.co/OpenGVLab/InternVL2_5-78B # 进入权重目录下打patch文件,${work_dir}为工作目录根据实际修改 cd InternVL2_5-78B && git apply ${work_dir}/llm_train/AscendFactory/third-party/internvl25-8b.patch
- InternVL2_5-8B:
support.huaweicloud.com/bestpractice-modelarts/modelarts_llm_train_591014.html
下载AI开发平台MODELARTS用户手册完整版