Views
No views yet
1import torch
2from torchvision import models
3from huggingface_hub import hf_hub_download
4
5model_path = hf_hub_download(repo_id="Kirandwip/Genre_prediction", filename="perfection_model_99.pth")
6
7model = models.efficientnet_b3(weights=None)
8model.classifier[1] = torch.nn.Linear(model.classifier[1].in_features, 10)
9model.load_state_dict(torch.load(model_path, map_location="cpu"))
10model.eval()