bert-for-tf2
bert-for-tf2 copied to clipboard
support for dynamic length input
Instead of fixed length input:
max_seq_len = 128 l_input_ids = keras.layers.Input(shape=(max_seq_len,), dtype='int32') l_token_type_ids = keras.layers.Input(shape=(max_seq_len,), dtype='int32')
Is it possible to support dynamic length input like:
l_input_ids = keras.layers.Input(shape=(None,), dtype='int32') l_token_type_ids = keras.layers.Input(shape=(None,), dtype='int32')
Padding every single example makes the inference quite slower, especially when the length of inputs vary a lot.
I have the same issue