Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stanfordnlp/stanza.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Bauer <horatio@gmail.com>2022-10-26 18:50:49 +0300
committerJohn Bauer <horatio@gmail.com>2022-10-26 18:50:49 +0300
commit3310814c227f98ed4f10cb081c8d59555b2a7d30 (patch)
tree0e3a90e600b44d1f1028193c66eeb4a1ed7be0d0
parent0e0d1ee5d785b26e0c12de60d4f5f9e88c482411 (diff)
Existing POS models with bert would be broken when looking at the args, so instead do .get()
-rw-r--r--stanza/models/pos/model.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/stanza/models/pos/model.py b/stanza/models/pos/model.py
index 27d20d1f..90903cd1 100644
--- a/stanza/models/pos/model.py
+++ b/stanza/models/pos/model.py
@@ -63,7 +63,7 @@ class Tagger(nn.Module):
if self.args['bert_model']:
bert_model, bert_tokenizer = load_bert(self.args['bert_model'], foundation_cache)
input_size += bert_model.config.hidden_size
- if args['bert_hidden_layers']:
+ if args.get('bert_hidden_layers', False):
# The average will be offset by 1/N so that the default zeros
# repressents an average of the N layers
self.bert_layer_mix = nn.Linear(args['bert_hidden_layers'], 1, bias=False)