Spaces:
Sleeping

File size: 356 Bytes
07ba06f
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import torch
from transformers import AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM-135M-Instruct", local_files_only=True)
h_last = torch.randn(1, 5, 576, dtype=torch.float32)
try:
    logits = model.lm_head(h_last)[:, -1, :]
    print("Logits shape:", logits.shape)
except Exception as e:
    print("ERROR:", e)