Skip to content

Commit

Permalink
fix rust & mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Fuchs committed Jul 31, 2023
1 parent 077a7d3 commit 66a26c3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion flair/embeddings/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class PrecomputedImageEmbeddings(ImageEmbeddings):
def __init__(self, url2tensor_dict, name) -> None:
self.url2tensor_dict = url2tensor_dict
self.name = name
self.__embedding_length = len(list(self.url2tensor_dict.values())[0])
self.__embedding_length = len(next(iter(self.url2tensor_dict.values())))
self.static_embeddings = True
super().__init__()

Expand Down
2 changes: 1 addition & 1 deletion flair/models/multitask_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def split_batch_to_task_ids(sentences: Union[List[Sentence], Sentence], all_task
batch_to_task_mapping[multitask_id.value] = [sentence_id]
return batch_to_task_mapping

def evaluate(
def evaluate( # type: ignore[override]
self,
data_points,
gold_label_type: str,
Expand Down
2 changes: 1 addition & 1 deletion flair/trainers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def train_custom(
if inspect.isclass(sampler):
sampler = sampler()
# set dataset to sample from
sampler.set_dataset(train_data)
sampler.set_dataset(train_data) # type: ignore[union-attr]
shuffle = False

# this field stores the names of all dynamic embeddings in the model (determined after first forward pass)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ def test_masakhane_corpus(tasks_base_path):
"bam": {"train": 4462, "dev": 638, "test": 1274},
"bbj": {"train": 3384, "dev": 483, "test": 966},
"ewe": {"train": 3505, "dev": 501, "test": 1001},
"fon": {"train": 4343, "dev": 621, "test": 1240},
"fon": {"train": 4343, "dev": 623, "test": 1228},
"hau": {"train": 5716, "dev": 816, "test": 1633},
"ibo": {"train": 7634, "dev": 1090, "test": 2181},
"kin": {"train": 7825, "dev": 1118, "test": 2235},
Expand Down

0 comments on commit 66a26c3

Please sign in to comment.