Skip to content

Commit e8e142d

Browse files
authored
Fixed failing BioGPT batch generation test (#42677)
Fixed failing BioGPT batch generation test
1 parent ad54104 commit e8e142d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/models/biogpt/test_modeling_biogpt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,9 @@ def test_batch_generation(self):
335335

336336
num_paddings = inputs_non_padded.shape[-1] - inputs["attention_mask"][-1].long().sum().item()
337337
inputs_padded = tokenizer(sentences[1], return_tensors="pt").input_ids.to(torch_device)
338-
output_padded = model.generate(input_ids=inputs_padded, max_length=model.config.max_length - num_paddings)
338+
output_padded = model.generate(
339+
input_ids=inputs_padded, max_length=model.generation_config.max_length - num_paddings
340+
)
339341

340342
batch_out_sentence = tokenizer.batch_decode(outputs, skip_special_tokens=True)
341343
non_padded_sentence = tokenizer.decode(output_non_padded[0], skip_special_tokens=True)

0 commit comments

Comments
 (0)