PaddleNLP icon indicating copy to clipboard operation
PaddleNLP copied to clipboard

[Question]: 基于uie-base进行微调时,如何增加模型输入的最大长度,直接在微调命令中修改max_seq_length训练会直接报错

Open Spider4U opened this issue 2 years ago • 1 comments

请提出你的问题

如何增加模型输入的最大长度,直接在微调命令中修改max_seq_length训练会直接报错

uie-max-seq

Spider4U avatar Jul 07 '23 08:07 Spider4U

uie-base的默认最大长度是512,如果需要延长最大长度,需要修改max_position_embeddings,但这样的话超出512长度的position embeddings会被随机初始化,会影响效果。

https://github.com/PaddlePaddle/PaddleNLP/blob/ae0bea9e8580bbedea96b45d4153be7a8b884d74/paddlenlp/transformers/ernie/modeling.py#L71C20-L71C43

w5688414 avatar May 07 '24 10:05 w5688414