Spaces:
Runtime error
Runtime error
File size: 724 Bytes
4dd13a6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # models.py
import torch.nn as nn
class DistilBERTClassifier(nn.Module):
def __init__(self, num_classes):
super(DistilBERTClassifier, self).__init__()
self.dropout = nn.Dropout(0.1)
self.classifier = nn.Linear(768, num_classes)
def forward(self, x):
# forward pass here
pass
class EmotionClassifier(nn.Module):
def __init__(self, input_size, hidden_size, num_classes):
super(EmotionClassifier, self).__init__()
self.fc1 = nn.Linear(input_size, hidden_size)
self.relu = nn.ReLU()
self.fc2 = nn.Linear(hidden_size, num_classes)
def forward(self, x):
out = self.fc1(x)
out = self.relu(out)
return self.fc2(out)
|