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

llama3.1-8B微调后推理没有结果 #231

Open
Telogen opened this issue Aug 1, 2024 · 3 comments
Open

llama3.1-8B微调后推理没有结果 #231

Telogen opened this issue Aug 1, 2024 · 3 comments

Comments

@Telogen
Copy link

Telogen commented Aug 1, 2024

微调完毕,按照教程重启模型后,在model.generate部产生警报

The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.
Setting `pad_token_id` to `eos_token_id`:128001 for open-end generation.
The attention mask is not set and cannot be inferred from input because pad token is same as eos token.As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.

但代码仍然可以跑,最终的response为空。

如果添加参数pad_token_id = tokenizer.eos_token_id,警报消失,代码仍然可以跑,但response仍然为空,请问这是怎么回事,谢谢!

@zzdandyy
Copy link

zzdandyy commented Aug 5, 2024

+1

@xturan
Copy link

xturan commented Aug 13, 2024

我也遇到了同样的问题,我把生成的结果打印出来得到输出如下:
“Generated IDs: [tensor([128009], device='cuda:0')]
<|eot_id|>”
就只有一个输出,并且译码完后是<|eot_id|>。

@Uncle-Yuanl
Copy link

1、使用huggingface models里面的config,不要使用hf提供的meta转hf的脚本
2、transformers版本不要低于readme中的版本
3、避免手动指定chat_tempalte。如果保证前两点,应该是不需要手动指定

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

4 participants