| 469 | moe_layer_index, *decoding_weight_list) |
| 470 | |
| 471 | def forward(self, beam_width, max_seq_len, top_k, top_p, |
| 472 | beam_search_diversity_rate, temperature, |
| 473 | len_penalty, repetition_penalty, presence_penalty, min_length, random_seed, |
| 474 | mem_hidden_states, mem_seq_len, |
| 475 | is_return_output_log_probs, is_return_cum_log_probs, is_return_cross_attentions=False, |
| 476 | bad_words_list=None, stop_words_list=None): |
| 477 | # TODO (bhsueh) Not found an method to put a None Type into op forward function |
| 478 | # So, the top_k and top_p must be some values now. |
| 479 | results = self.decoding.forward(beam_width, max_seq_len, |
| 480 | top_k, top_p, beam_search_diversity_rate, |
| 481 | temperature, len_penalty, repetition_penalty, presence_penalty, min_length, |
| 482 | random_seed, mem_hidden_states, mem_seq_len, |
| 483 | is_return_output_log_probs, is_return_cum_log_probs, is_return_cross_attentions, |
| 484 | bad_words_list, stop_words_list) |
| 485 | return results |
| 486 | |
| 487 | |
| 488 | class FTT5(nn.Module): |