Skip to content

Commit

Permalink
Numpy typing fix (#94)
Browse files Browse the repository at this point in the history
Force merge this and fix the rest of the problem in the upcoming PR.

* update numpy typing

* revised typing and checked mypy

* remove plugin requirement and see if it can pass the test

* roll back to 1.19 typing

* ignore the typing check for the line since 1.21 typing system numpy.typing is missing in earlier numpy version

* black

* remove numpy typing

* black
  • Loading branch information
hepengfe authored Mar 4, 2022
1 parent 80cfe19 commit 2c1b268
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ follow_imports = skip

[mypy-numpy]
follow_imports = skip

4 changes: 3 additions & 1 deletion src/huggingface/fortex/huggingface/bio_ner_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ def initialize(self, resources: Resources, configs: Config):
@torch.no_grad()
def predict(
self, data_batch: Dict[str, Dict[str, List[str]]]
) -> Dict[str, Dict[str, List[np.array]]]:
) -> Dict[str, Dict[str, List]]: # numpy typing is removed due to
# incompatibility issues due to upgrading from numpy verions 1.19 to
# 1.21
sentences = data_batch["context"]
subwords = data_batch["Subword"]

Expand Down

0 comments on commit 2c1b268

Please sign in to comment.