Views
No views yet
(B, A, L)(B, D) via projection headalphabet_size: 27target_size: 128channel: 256depth: 3kernel_size: 7l2norm: True1import json, torch
2from safetensors.torch import load_file
3
4# Load config
5cfg = json.load(open("config.json","r"))
6from model import CNNED_Protein
7model = CNNED_Protein(**cfg).eval()
8
9# Load weights
10try:
11 sd = load_file("model.safetensors")
12except Exception:
13 sd = torch.load("model.pt", map_location="cpu")
14model.load_state_dict(sd, strict=True)
15model.eval()
16
17# Dummy inference
18# x: (B, A, L) one-hot tensor
19x = torch.randn(2, cfg['alphabet_size'], 512)
20y, z = model.encode(x)
21print(y.shape) # (2, target_size)