Skip to content

Commit

Permalink
fixing evaluate typing
Browse files Browse the repository at this point in the history
  • Loading branch information
chanind committed May 8, 2022
1 parent 16a227c commit 3cd3c33
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frame_semantic_transformer/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def evaluate(
predictions = batch_predict(model, tokenizer, inputs)
for sample, prediction in zip(samples_chunk, predictions):
true_pos, false_pos, false_neg = sample.evaluate_prediction(prediction)
results[sample.get_task()][0] += true_pos
results[sample.get_task()][1] += false_pos
results[sample.get_task()][2] += false_neg
results[sample.get_task_name()][0] += true_pos
results[sample.get_task_name()][1] += false_pos
results[sample.get_task_name()][2] += false_neg
return results
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ disallow_any_generics = True
check_untyped_defs = True
disallow_untyped_defs = True
namespace_packages = True
mypy_path = $MYPY_CONFIG_FILE_DIR/stubs

[mypy-tests.*]
ignore_missing_imports = True
Expand Down
5 changes: 5 additions & 0 deletions stubs/tqdm.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Any, Iterable, Iterator, TypeVar

_T = TypeVar("_T")

def tqdm(iterable: Iterable[_T], *args: Any, **kwargs: Any) -> Iterator[_T]: ...

0 comments on commit 3cd3c33

Please sign in to comment.