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

This commit is contained in:
LysandreJik committed 2019-08-08 18:20:32 -04:00
1 parent e367ac469c
commit 6c41a8f5dc
4 files changed
+81 -79

No files matched your search

+1 -2
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.