Views
No views yet
1import torch, timm
2from huggingface_hub import hf_hub_download
3
4path = hf_hub_download(repo_id="jingxizhang/birdclef2026-model", filename="best_model.pth")
5ckpt = torch.load(path, map_location="cpu", weights_only=False)
6model = timm.create_model(
7 ckpt["cfg"]["model_name"], pretrained=False,
8 num_classes=len(ckpt["species_list"])
9)
10model.load_state_dict(ckpt["model_state_dict"])
11model.eval()
12print("Species:", ckpt["species_list"][:5])