Spaces:
Runtime error
Runtime error
Download app/models.py from AkhilJoshi/EmotionDetection: direct link, hf CLI and curl.
- Browser
- Download file 724 Bytes
-
https://huggingface.co/spaces/AkhilJoshi/EmotionDetection/resolve/main/app/models.py
- Command line
-
hf download hf://spaces/AkhilJoshi/EmotionDetection/app/models.py
-
curl -L -o models.py https://huggingface.co/spaces/AkhilJoshi/EmotionDetection/resolve/main/app/models.py
724 Bytes
| # 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) | |