Download model/model.py from mathminakshi/Cifar_classification_using_ReseNet50: direct link, hf CLI and curl.
- Browser
- Download file 344 Bytes
-
https://huggingface.co/spaces/mathminakshi/Cifar_classification_using_ReseNet50/resolve/main/model/model.py
- Command line
-
hf download hf://spaces/mathminakshi/Cifar_classification_using_ReseNet50/model/model.py
-
curl -L -o model.py https://huggingface.co/spaces/mathminakshi/Cifar_classification_using_ReseNet50/resolve/main/model/model.py
344 Bytes
| import torch.nn as nn | |
| import torchvision.models as models | |
| class ResNet50(nn.Module): | |
| def __init__(self, num_classes): | |
| super(ResNet50, self).__init__() | |
| self.model = models.resnet50(weights=None) | |
| self.model.fc = nn.Linear(self.model.fc.in_features, num_classes) | |
| def forward(self, x): | |
| return self.model(x) |