Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微调token长度的问题 #384

Open
jichaoqun opened this issue Mar 6, 2024 · 1 comment
Open

微调token长度的问题 #384

jichaoqun opened this issue Mar 6, 2024 · 1 comment

Comments

@jichaoqun
Copy link

在微调baichuan2-7B-Base模型的时候,发现,输入的token长度不能超过512,其官方给出的最大长度为4096。
微调遵循官方教程,使用lora的方式,在微调过程中使用官方数据集,在数据中添加超长数据时出现
Token indices sequence length is longer than the specified maximum sequence length for this model (1759 > 512). Running this sequence through the model will result in indexing errors

请问,是否需要修改相关配置文件或是相关代码?还是7B的模型本身不支持超长序列的输入?

@GuntherCentralPerkRing
Copy link

同样的问题
Traceback (most recent call last):
File "/home/ma-user/work/mindformers/research/baichuan2/run_baichuan2_pipeline.py", line 145, in
outputs = pipeline_task(inputs,
File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindformers/pipeline/base_pipeline.py", line 121, in call
outputs = self.run_multi(inputs, batch_size, preprocess_params, forward_params, postprocess_params)
File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindformers/pipeline/text_generation_pipeline.py", line 208, in run_multi
outputs.extend(self.run_single(item, preprocess_params,
File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindformers/pipeline/base_pipeline.py", line 170, in run_single
model_outputs = self.forward(model_inputs, **forward_params)
File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindformers/pipeline/text_generation_pipeline.py", line 224, in forward
output_ids = self.network.generate(input_ids, **forward_params)
File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindformers/generation/text_generator.py", line 1120, in generate
output_ids = self._greedy_search(
File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindformers/generation/text_generator.py", line 315, in _greedy_search
raise ValueError(
ValueError: the input_ids length 757 exceeds the max length config 512.check your inputs and set max_length larger than your inputs length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants