From b25fe0a761ddc9fc7936f0fd8a629071ad4374a8 Mon Sep 17 00:00:00 2001 From: Johnny Hsieh <32300164+mnixry@users.noreply.github.com> Date: Fri, 6 Oct 2023 23:04:31 +0800 Subject: [PATCH 1/2] Update requirements.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index b61ed42..1ee0ba3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ torch pyqt6 opencc +tqdm From 576c06fbbfada1afe5bbbec280d537da31d3b0ee Mon Sep 17 00:00:00 2001 From: Johnny Hsieh <32300164+mnixry@users.noreply.github.com> Date: Fri, 6 Oct 2023 23:04:57 +0800 Subject: [PATCH 2/2] Update beam_decoder.py --- beam_decoder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beam_decoder.py b/beam_decoder.py index b9768ef..e9bb93f 100644 --- a/beam_decoder.py +++ b/beam_decoder.py @@ -1,4 +1,5 @@ import torch +import tqdm class Beam: @@ -214,7 +215,7 @@ def collect_hypothesis_and_scores(inst_dec_beams, n_best): inst_idx_to_position_map = get_inst_idx_to_tensor_position_map(active_inst_idx_list) # -- Decode - for len_dec_seq in range(1, max_len + 1): + for len_dec_seq in tqdm.tqdm(range(1, max_len + 1)): if is_terminated is not None and is_terminated(): return None, None