The error is being thrown in line 106 of https://github.com/facebookresearch/EmpatheticDialogues/blob/master/retrieval_train.py 1 “dtype = model.module.opt.dataset_name”
BertAdapter is defined in https://github.com/facebookresearch/EmpatheticDialogues/blob/master/empchat/bert_local.py 1
class BertAdapter(nn.Module):
def init(self, opt, dictionary):
from parlai.agents.bert_ranker.helpers import BertWrapper
    try:
        from pytorch_pretrained_bert import BertModel
    except ImportError:
        raise Exception(
            "BERT rankers needs pytorch-pretrained-BERT installed. "
            "\npip install pytorch-pretrained-bert"
        )
    super().__init__()
    self.opt = opt
    self.pad_idx = dictionary[PAD_TOKEN]
    self.ctx_bert = BertWrapper(
        bert_model=BertModel.from_pretrained(BERT_ID),
        output_dim=opt.bert_dim,
        add_transformer_layer=opt.bert_add_transformer_layer,
    )
    self.cand_bert = BertWrapper(
        bert_model=BertModel.from_pretrained(BERT_ID),
        output_dim=opt.bert_dim,
        add_transformer_layer=opt.bert_add_transformer_layer,
    )

…