Accessing a model's individual layer
I want to access one of a LLM's individual layers and get output from it (like how nn.Linear() works). I tried using model.layer[0](tokenizer.encode("hi")) but that wouldn't work. If someone can give me the proper way to do this, it would be appreciated. I'm using Python for this with the transformers and Pytorch libraries.
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.