Instructions to use CuriosLM/gpt2-124m-fineweb-edu with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CuriosLM/gpt2-124m-fineweb-edu with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CuriosLM/gpt2-124m-fineweb-edu")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CuriosLM/gpt2-124m-fineweb-edu") model = AutoModelForCausalLM.from_pretrained("CuriosLM/gpt2-124m-fineweb-edu", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CuriosLM/gpt2-124m-fineweb-edu with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CuriosLM/gpt2-124m-fineweb-edu" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CuriosLM/gpt2-124m-fineweb-edu", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/CuriosLM/gpt2-124m-fineweb-edu
- SGLang
How to use CuriosLM/gpt2-124m-fineweb-edu with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "CuriosLM/gpt2-124m-fineweb-edu" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CuriosLM/gpt2-124m-fineweb-edu", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "CuriosLM/gpt2-124m-fineweb-edu" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CuriosLM/gpt2-124m-fineweb-edu", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use CuriosLM/gpt2-124m-fineweb-edu with Docker Model Runner:
docker model run hf.co/CuriosLM/gpt2-124m-fineweb-edu
CuriosLM/gpt2-124m-fineweb-edu
Model A: GPT-2 small (124M) trained from scratch, the baseline of a controlled comparison with a Gemma-style model trained identically.
A small research model from the CuriosLM project, released for reproducibility and study. It is a base model: not instruction-tuned and not safety-tuned, so it can produce false, biased or nonsensical text.
Read more in the write-up, Part 1, pretraining and Part 2, inference, positions, attention and context extension; the code is at Shinibali/CuriosLM.
Architecture
- GPT-2 small, unchanged: 12 layers, 12 heads, d_model 768, learned absolute positions (1,024), GELU MLP, pre-LayerNorm, biases on.
Training
- Data: 100% HuggingFaceFW/fineweb-edu (
sample-10BT) - Tokens: 9.83B, 20,000 optimizer steps
- AdamW, peak learning rate 0.0006 with 760 warmup steps and cosine decay to 6e-05, weight decay 0.1, seed 1337
- Tokens per step: 491,520
Results
| Evaluation | Score |
|---|---|
| Perplexity, held-out FineWeb-Edu | 21.89 |
| Perplexity, held-out Cosmopedia-v2 | 20.31 |
| ARC-Easy (acc) | 52.4% |
| HellaSwag (acc_norm) | 32.4% |
| LAMBADA (acc) | 24.2% |
| LAMBADA (perplexity) | 111.1 |
Perplexity on about 2M held-out tokens of each dataset; benchmarks zero-shot with EleutherAI's lm-evaluation-harness.
Usage
Standard 🤗 GPT-2 format:
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("CuriosLM/gpt2-124m-fineweb-edu")
model = AutoModelForCausalLM.from_pretrained("CuriosLM/gpt2-124m-fineweb-edu")
ids = tokenizer("The mitochondria is", return_tensors="pt").input_ids
print(tokenizer.decode(model.generate(ids, max_new_tokens=40, do_sample=True, top_k=50)[0]))
- Downloads last month
- 676