Fix ValueError when testing PyTorch performance (#14450)

### Description
Fixed an exception that is thrown inside `transformers` when trying to
test PyTorch performance:
```
> python convert_generation.py -m gpt2 --output gpt2_greedy_search.onnx --num_beams 1 --num_return_sequences 1 --torch_performance
This commit is contained in:
Ivan Komarov 2023-02-25 08:39:14 +03:00 committed by GitHub
parent 6603be26c6
commit 9f6d452ca6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1850,7 +1850,7 @@ def test_torch_performance(
num_return_sequences=args.num_return_sequences,
length_penalty=args.length_penalty,
repetition_penalty=args.repetition_penalty,
bad_words_ids=bad_words_ids,
bad_words_ids=bad_words_ids if bad_words_ids else None,
return_dict_in_generate=True,
output_scores=args.output_sequences_scores or args.output_token_scores,
)