Downloads · 30 days
0
mia-project-2025/pythia-1B-feature-extraction-wikitext-103
pythia-1B-feature-extraction-wikitext-103 is a machine learning model from mia-project-2025. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This repository contains a feature-based transfer learning experiment using the EleutherAI/pythia-1b model on the WikiText-103 dataset. The base model was frozen, and a lightweight trainable classification head was ad…
Downloads · 30 days
0
Access
Public
Updated Aug 30, 2025
Repo size
13.9 GB
Likes
0
Public
Click a slice to open those files.
.safetensors8.1 GB · 58%
From the Hugging Face model README
This repository contains a feature-based transfer learning experiment using the EleutherAI/pythia-1b model on the WikiText-103 dataset.
The base model was frozen, and a lightweight trainable classification head was added for causal language modeling.
The base model (gpt_neox) was frozen to retain pretrained knowledge. A new head (2-layer feedforward with ReLU and dropout) was trained on top of the hidden states for efficient adaptation.
from transformers import AutoTokenizer
import torch
from model import FrozenPythiaWithNewHead
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("./pythia-wikitext-feature")
# Load model
model = FrozenPythiaWithNewHead.from_pretrained("./pythia-wikitext-feature")
model.eval()
# Example
input_text = "The history of natural language processing"
inputs = tokenizer(input_text, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
logits = outputs["logits"]
next_token_id = torch.argmax(logits[:, -1, :], dim=-1)
print("Next token:", tokenizer.decode(next_token_id))