We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f42da6d commit b0b86bdCopy full SHA for b0b86bd
1 file changed
packages/transformers/src/models/modeling_utils.js
@@ -1448,14 +1448,7 @@ export class PreTrainedModel extends Callable {
1448
}
1449
1450
if (generation_config.return_dict_in_generate) {
1451
- let past_key_values_for_return = past_key_values;
1452
- if (is_beam_search) {
1453
- console.warn(
1454
- 'Beam search does not return aligned past_key_values for finalized sequences. ' +
1455
- 'past_key_values will be null; re-generate without beam search if you need caching.',
1456
- );
1457
- past_key_values_for_return = null;
1458
- }
+ const past_key_values_for_return = is_beam_search ? null : past_key_values;
1459
return {
1460
sequences,
1461
past_key_values: past_key_values_for_return,
0 commit comments