We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
使用bf16加载 相同的两条数据,通过batch方式生成则会出现nan 如果将相同的数据逐条输入则不会出现nan
inputs = prompt be = tokenizer(inputs, return_tensors='pt', padding=True) input_ids = be.input_ids.to(model.device) attention_mask = be.attention_mask attention_mask = attention_mask.to(model.device) gen_kwargs = { "max_length": max_length, "do_sample": False, "repetition_penalty": 1.0, "num_return_sequences" :1 } output_ids = model.generate(input_ids=input_ids, attention_mask=attention_mask, **gen_kwargs)
The text was updated successfully, but these errors were encountered:
我是有结果,但是Batch 推理的时候结果和逐条不完全一致
Sorry, something went wrong.
#291 这个应该能解决你的问题
请问如何进行batch推理?
No branches or pull requests
使用bf16加载
相同的两条数据,通过batch方式生成则会出现nan
如果将相同的数据逐条输入则不会出现nan
The text was updated successfully, but these errors were encountered: