Instructions to use submarat/gpt2-small-fineweb-edu-10b-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use submarat/gpt2-small-fineweb-edu-10b-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="submarat/gpt2-small-fineweb-edu-10b-sft")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("submarat/gpt2-small-fineweb-edu-10b-sft") model = AutoModelForCausalLM.from_pretrained("submarat/gpt2-small-fineweb-edu-10b-sft", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use submarat/gpt2-small-fineweb-edu-10b-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "submarat/gpt2-small-fineweb-edu-10b-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "submarat/gpt2-small-fineweb-edu-10b-sft", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/submarat/gpt2-small-fineweb-edu-10b-sft
- SGLang
How to use submarat/gpt2-small-fineweb-edu-10b-sft 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 "submarat/gpt2-small-fineweb-edu-10b-sft" \ --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": "submarat/gpt2-small-fineweb-edu-10b-sft", "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 "submarat/gpt2-small-fineweb-edu-10b-sft" \ --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": "submarat/gpt2-small-fineweb-edu-10b-sft", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use submarat/gpt2-small-fineweb-edu-10b-sft with Docker Model Runner:
docker model run hf.co/submarat/gpt2-small-fineweb-edu-10b-sft
GPT-2 Small — instruction-tuned (SFT) toy assistant
Instruction-tuned version of submarat/gpt2-small-fineweb-edu-10b
(a 124M GPT-2 reproduced from scratch on 10B FineWeb-Edu tokens), fine-tuned on
Alpaca-cleaned with TRL's
SFTTrainer (completion-only loss).
- Interactive demo: https://huggingface.co/spaces/submarat/gpt2-fineweb-chat
- Code: https://github.com/submarat/gpt2-small-repro (
posttraining/) - Write-up: https://submarat.github.io/a-toy-assistant-sft-and-dpo/
It's a toy: at 124M it follows simple instructions and holds the format, but it's shallow and hallucinates confidently. That's the point — it's a hands-on pretrain → SFT pipeline, not a usable product.
Prompt format (Alpaca-style)
### Instruction:
{instruction}
### Response:
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
m = AutoModelForCausalLM.from_pretrained("submarat/gpt2-small-fineweb-edu-10b-sft")
tok = AutoTokenizer.from_pretrained("submarat/gpt2-small-fineweb-edu-10b-sft")
prompt = "### Instruction:\nList three tips for staying focused while studying.\n\n### Response:\n"
ids = tok(prompt, return_tensors="pt").input_ids
out = m.generate(ids, max_new_tokens=80, do_sample=True, top_k=40, temperature=0.7,
repetition_penalty=1.3, pad_token_id=tok.eos_token_id)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
Training
- Base:
submarat/gpt2-small-fineweb-edu-10b(124M, exact-GELU) - Data: Alpaca-cleaned (~52k), formatted as prompt/completion; loss on the response only
- 3 epochs, batch 64, LR 2e-5 cosine, bf16, ctx 512
Trained alongside a DPO variant, submarat/gpt2-small-fineweb-edu-10b-dpo.
- Downloads last month
- 44