-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Bug]: Llama3无法生成eos_token #8351
Labels
bug
Something isn't working
Comments
你好!我已经找到了这个问题。Meta-Llama-3-8B-Instruct 在生成时,eos_token是另一special_token 即 我手动加入128009,可以成功让模型自然停止生成。 messages = [
{"role": "system", "content": "You are an expert at planning marketing events outdoors for small to medium size diners and restaurants. "},
{"role": "user", "content": "Help a local McDonald restaurant plan a promotion event for the anniversary of Big Mac."},
]
input_ids = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pd"
)
terminators = [
tokenizer.eos_token_id,
# tokenizer.convert_tokens_to_ids("<|eot_id|>")
128009,
]
outputs = model.generate(
**input_ids,
max_new_tokens=1024,
eos_token_id=terminators,
do_sample=True,
temperature=0.6,
top_p=0.9,
)
out = tokenizer.batch_decode( outputs[0] )
HF model card例子: messages = [
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
{"role": "user", "content": "Who are you?"},
]
我不了解paddlenlp如何加载多个config文件,请你们想办法把这个改一下吧,拜托了🙏。 |
好的,我们检查一下 |
#8371 已提pr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
软件环境
- paddlenlp: develop
重复问题
错误描述
稳定复现步骤 & 代码
The text was updated successfully, but these errors were encountered: