I doubt the issue is with Step 1: Define your pre-attention Bi-LSTM. Double-check how you are coding that. I think you need to specify the input shape in Bidirectional.
I tried to remove the tag “inputs=” but same error.
In step 1 of modelf, I use Bidirectional(LSTM(units=Tx,return_sequences=True))(X)
I passed all the test for one_step_attention: I used s_prev = repeator(s_prev)
Here you go. Tx is the length of the input sequence and it is not the same as units. Think about it. Hint: what is the difference between the length of the input sequence and the hidden state size?