models icon indicating copy to clipboard operation
models copied to clipboard

Fix the Bert2Bert call when padded_decode is set to True

Open LoicDagnas opened this issue 3 years ago • 1 comments

Description

As mentioned in the following issue, it was impossible to call a Bert2Bert model with the configuration option padded_decode set to True.

It comes from how the beam search modules deals with batch size. The special case implemented when padded_decode is True doesn't seem useful and caused the following error:

TypeError: Failed to convert object of type <class 'list'> to Tensor. Contents: [None, 1]. Consider casting elements to a supported type.

Type of change

  • [x] Bug fix (non-breaking change which fixes an issue)

Tests

I have added a naive unittest which failed before my modification and passes now.

Checklist

LoicDagnas avatar Nov 16 '21 15:11 LoicDagnas

@saberkun or anyone else if you have a bit of time for this one, it will be very helpful. It is quite critical to make my model serveable in ONNX run time or in TPU vms.

If I have to modify the code or add unittest, just tell me :)

Thanks in advance !

LoicDagnas avatar Dec 06 '21 15:12 LoicDagnas

Hi @LoicDagnas,

In future, please open an issue and discuss with us before submitting a pull request. If the change does not align with our best practices, we can provide early feedback. Please review guidelines here: https://github.com/tensorflow/models/wiki/Submitting-a-pull-request

Thanks.

laxmareddyp avatar Jan 26 '24 21:01 laxmareddyp