We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
BioGPT
1 parent ad54104 commit e8e142dCopy full SHA for e8e142d
tests/models/biogpt/test_modeling_biogpt.py
@@ -335,7 +335,9 @@ def test_batch_generation(self):
335
336
num_paddings = inputs_non_padded.shape[-1] - inputs["attention_mask"][-1].long().sum().item()
337
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)
+ output_padded = model.generate(
339
+ input_ids=inputs_padded, max_length=model.generation_config.max_length - num_paddings
340
+ )
341
342
batch_out_sentence = tokenizer.batch_decode(outputs, skip_special_tokens=True)
343
non_padded_sentence = tokenizer.decode(output_non_padded[0], skip_special_tokens=True)
0 commit comments