Download hubconf.py from AI417UPM/AlexNet: direct link, hf CLI and curl.
- Browser
- Download file 248 Bytes
-
https://huggingface.co/AI417UPM/AlexNet/resolve/main/hubconf.py
- Command line
-
hf download hf://AI417UPM/AlexNet/hubconf.py
-
curl -L -o hubconf.py https://huggingface.co/AI417UPM/AlexNet/resolve/main/hubconf.py
248 Bytes
| import torch | |
| from model import CNNModel | |
| def AlexNet(pretrained=True): | |
| model = CNNModel() | |
| if pretrained: | |
| state_dict = torch.load("alexnet_weights.pth", map_location="cpu") | |
| model.load_state_dict(state_dict) | |
| return model |