Skip to content

Commit

Permalink
Fix imcomplete sentence
Browse files Browse the repository at this point in the history
  • Loading branch information
ayaka14732 committed Apr 6, 2022
1 parent ee63dc7 commit b6b51f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nmt_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def fwd_encode(params: dict, src: np.ndarray, mask_enc: np.ndarray) -> np.ndarra
mask_enc = np.einsum('bi,bj->bij', mask_enc_1d, mask_enc_1d)[:, None]

encoder_last_hidden_output = fwd_encode(params, src, mask_enc)
generate_ids = generator.generate(encoder_last_hidden_output, mask_enc_1d, num_beams=5)
generate_ids = generator.generate(encoder_last_hidden_output, mask_enc_1d, num_beams=5, max_length=100000)
decoded_sentences = tokenizer_en.batch_decode(generate_ids, skip_special_tokens=True)

for translated_sentence in decoded_sentences:
Expand Down

0 comments on commit b6b51f9

Please sign in to comment.