Skip to content

Commit

Permalink
fix(lint): Fix flake8 lint
Browse files Browse the repository at this point in the history
  • Loading branch information
xingchensong committed Dec 7, 2022
1 parent beb2860 commit 5c2a81a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion runtime/gpu/model_repo/scoring/1/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def execute(self, requests):
hyps = []
idx = 0
for cands, cand_lens in zip(in_hyps_pad_sos_eos, in_hyps_lens_sos,
strict=True):
strict=True):
best_idx = best_index[idx][0]
best_cand_len = cand_lens[best_idx] - 1 # remove sos
best_cand = cands[best_idx][1: 1 + best_cand_len].tolist()
Expand Down
4 changes: 2 additions & 2 deletions test/test_tokenize.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ def test_tokenize(symbol_table_path):
for (hyp, ref) in zip(outs, refs, strict=True):
assert(len(hyp["tokens"]) == len(ref["tokens"]))
assert(all([h == r for h, r in zip(hyp["tokens"], ref["tokens"],
strict=True)]))
strict=True)]))
assert(len(hyp["label"]) == len(ref["label"]))
assert(all([h == r for h, r in zip(hyp["label"], ref["label"],
strict=True)]))
strict=True)]))

@pytest.mark.parametrize("use_pbe_model", [True, False])
def test_non_lang_symbol_tokenize(use_pbe_model):
Expand Down

0 comments on commit 5c2a81a

Please sign in to comment.