Update modeling.py
Browse files- modeling.py +1 -2
modeling.py
CHANGED
|
@@ -2,7 +2,6 @@ import torch
|
|
| 2 |
import torch.nn as nn
|
| 3 |
import torch.nn.functional as F
|
| 4 |
from transformers import PreTrainedModel, AutoModel, AutoConfig
|
| 5 |
-
from transformers.utils import ModelOutput
|
| 6 |
|
| 7 |
class Encoder(nn.Module):
|
| 8 |
def __init__(self, base_encoder):
|
|
@@ -45,7 +44,7 @@ class RobertaEmoPillars(PreTrainedModel):
|
|
| 45 |
inputs = {"input_ids": input_ids, "attention_mask": attention_mask}
|
| 46 |
emb = self.encoder(inputs)
|
| 47 |
logits = self.classifier(emb)
|
| 48 |
-
return
|
| 49 |
|
| 50 |
|
| 51 |
# --- Registration for AutoModel ---
|
|
|
|
| 2 |
import torch.nn as nn
|
| 3 |
import torch.nn.functional as F
|
| 4 |
from transformers import PreTrainedModel, AutoModel, AutoConfig
|
|
|
|
| 5 |
|
| 6 |
class Encoder(nn.Module):
|
| 7 |
def __init__(self, base_encoder):
|
|
|
|
| 44 |
inputs = {"input_ids": input_ids, "attention_mask": attention_mask}
|
| 45 |
emb = self.encoder(inputs)
|
| 46 |
logits = self.classifier(emb)
|
| 47 |
+
return logits
|
| 48 |
|
| 49 |
|
| 50 |
# --- Registration for AutoModel ---
|