Update search.py
Fix the issue of "translation result is dependent on batch size except for beam size of 1" in the previous implementation of beam search. The re-ordering of indices, outputs, masks, hidden states and attention vector should be done at each time step regardless of the conditional: if is_finished.any():
Loading
Please register or sign in to comment