Skip to content

Commit

Permalink
fix unrequred type ignore statements
Browse files Browse the repository at this point in the history
  • Loading branch information
helpmefindaname committed Oct 25, 2024
1 parent 4202333 commit a30fd78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flair/embeddings/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def _add_embeddings_internal(self, sentences: list[Sentence]):
sentence_tensor = self.word_reprojection_map(sentence_tensor)

# push through RNN
packed = pack_padded_sequence(sentence_tensor, lengths, enforce_sorted=False, batch_first=True) # type: ignore[arg-type]
packed = pack_padded_sequence(sentence_tensor, lengths, enforce_sorted=False, batch_first=True)
rnn_out, hidden = self.rnn(packed)
outputs, output_lengths = pad_packed_sequence(rnn_out, batch_first=True)

Expand Down
2 changes: 1 addition & 1 deletion flair/embeddings/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def _add_embeddings_internal(self, sentences: list[Sentence]):

character_embeddings = self.char_embedding(chars).transpose(0, 1)

packed = torch.nn.utils.rnn.pack_padded_sequence(character_embeddings, chars2_length) # type: ignore[arg-type]
packed = torch.nn.utils.rnn.pack_padded_sequence(character_embeddings, chars2_length)

lstm_out, self.hidden = self.char_rnn(packed)

Expand Down

0 comments on commit a30fd78

Please sign in to comment.