Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 7c0d5d5

Browse files
authored
Fix bug in QaNetEncoder, update pretrained model (#2773)
* Fix bug in QaNetEncoder, update pretrained model * pylint
1 parent 95b439d commit 7c0d5d5

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

allennlp/modules/seq2seq_encoders/qanet_encoder.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(self,
7474
self._input_projection_layer = lambda x: x
7575

7676
self._encoder_blocks = ModuleList([])
77-
for block_index in range(num_blocks):
77+
for _ in range(num_blocks):
7878
encoder_block = QaNetEncoderBlock(hidden_dim,
7979
hidden_dim,
8080
attention_projection_dim,
@@ -86,7 +86,6 @@ def __init__(self,
8686
dropout_prob,
8787
layer_dropout_undecayed_prob,
8888
attention_dropout_prob)
89-
self.add_module(f"encoder_block_{block_index}", encoder_block)
9089
self._encoder_blocks.append(encoder_block)
9190

9291
self._input_dim = input_dim

allennlp/pretrained.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def bidirectional_attention_flow_seo_2017() -> predictors.BidafPredictor:
4040
def naqanet_dua_2019() -> predictors.BidafPredictor:
4141
with warnings.catch_warnings():
4242
warnings.simplefilter(action="ignore", category=DeprecationWarning)
43-
model = PretrainedModel('https://s3-us-west-2.amazonaws.com/allennlp/models/naqanet-2019.03.01.tar.gz',
43+
model = PretrainedModel('https://s3-us-west-2.amazonaws.com/allennlp/models/naqanet-2019.04.29-fixed-weight-names.tar.gz',
4444
'machine-comprehension')
4545
return model.predictor() # type: ignore
4646

0 commit comments

Comments
 (0)