Skip to content

Commit

Permalink
removed references to local_params - n-th time:]
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Kornuta <[email protected]>
  • Loading branch information
tkornuta-nvidia committed Feb 4, 2020
1 parent face974 commit e59fcdb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/nlp/joint_intent_slot_infer_b1.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
pretrained_model_name=args.pretrained_bert_model
)
tokenizer = BertTokenizer.from_pretrained(args.pretrained_bert_model)
hidden_size = pretrained_bert_model.local_parameters["hidden_size"]
hidden_size = pretrained_bert_model.hidden_size

data_desc = JointIntentSlotDataDesc(args.data_dir, args.do_lower_case, args.dataset_name)

Expand Down
2 changes: 1 addition & 1 deletion examples/nlp/punctuation_capitalization_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
pretrained_bert_model = nemo.collections.nlp.nm.trainables.common.huggingface.BERT(
pretrained_model_name=args.pretrained_bert_model
)
hidden_size = pretrained_bert_model.local_parameters["hidden_size"]
hidden_size = pretrained_bert_model.hidden_size
tokenizer = NemoBertTokenizer(args.pretrained_bert_model)

data_layer = nemo.collections.nlp.nm.data_layers.token_classification_datalayer.BertTokenClassificationInferDataLayer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self, pad_id, label_smoothing=0, predict_last_k=0):
LossNM.__init__(self)

self._loss_fn = SmoothedCrossEntropyLoss(label_smoothing, predict_last_k)
self._pad_id = self.local_parameters['pad_id']
self._pad_id = pad_id

def _loss_function(self, logits, target_ids):
target_mask = mask_padded_tokens(target_ids, self._pad_id).to(logits.dtype)
Expand Down

0 comments on commit e59fcdb

Please sign in to comment.