Skip to content

Commit

Permalink
add tqdm for eval progress
Browse files Browse the repository at this point in the history
  • Loading branch information
chanind committed May 6, 2022
1 parent 0f3db83 commit 69d98ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frame_semantic_transformer/evaluate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations
from typing import Iterable
from tqdm import tqdm
from transformers import T5ForConditionalGeneration, T5Tokenizer
from nltk.corpus import framenet as fn

Expand All @@ -16,7 +17,7 @@ def evaluate(
samples: Iterable[SampleSentence],
) -> dict[str, list[int]]:
results: dict[str, list[int]] = {"frame": [0, 0, 0], "args": [0, 0, 0]}
for sample in samples:
for sample in tqdm(samples):
frame_task_input = sample.frame_classification_input
args_task_input = sample.frame_args_input

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ torch = "^1.11.0"
transformers = "^4.18.0"
sentencepiece = "^0.1.96"
pytorch-lightning = "^1.6.2"
tqdm = "^4.64.0"

[tool.poetry.dev-dependencies]
pytest = "^5.2"
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ namespace_packages = True
ignore_missing_imports = True

[mypy-nltk.*]
ignore_missing_imports = True

[mypy-tqdm.*]
ignore_missing_imports = True

0 comments on commit 69d98ac

Please sign in to comment.