Encode and Decode are back in the superclass. They now handle sentence pairs special tokens.

This commit is contained in:
LysandreJik
2019-08-08 18:20:32 -04:00
parent e367ac469c
commit 6c41a8f5dc
4 changed files with 81 additions and 79 deletions

View File

@@ -23,7 +23,7 @@ import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import CrossEntropyLoss
from torch.nn import CrossEntropyLoss, MSELoss
from pytorch_transformers.modeling_bert import (BertConfig, BertEmbeddings,
BertLayerNorm, BertModel,
@@ -144,7 +144,6 @@ class RobertaLMHead(nn.Module):
return x
class RobertaForSequenceClassification(BertPreTrainedModel):
"""
Roberta Model with a classifier head on top.