HuggingFaceFW/fineweb-edu
Viewer • Updated • 3.5B • 634k • 1.09k
How to use yuchenj/gpt2_774M_100B_FinewebEdu_hf with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="yuchenj/gpt2_774M_100B_FinewebEdu_hf") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("yuchenj/gpt2_774M_100B_FinewebEdu_hf")
model = AutoModelForCausalLM.from_pretrained("yuchenj/gpt2_774M_100B_FinewebEdu_hf")How to use yuchenj/gpt2_774M_100B_FinewebEdu_hf with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "yuchenj/gpt2_774M_100B_FinewebEdu_hf"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "yuchenj/gpt2_774M_100B_FinewebEdu_hf",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/yuchenj/gpt2_774M_100B_FinewebEdu_hf
How to use yuchenj/gpt2_774M_100B_FinewebEdu_hf with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "yuchenj/gpt2_774M_100B_FinewebEdu_hf" \
--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": "yuchenj/gpt2_774M_100B_FinewebEdu_hf",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "yuchenj/gpt2_774M_100B_FinewebEdu_hf" \
--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": "yuchenj/gpt2_774M_100B_FinewebEdu_hf",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use yuchenj/gpt2_774M_100B_FinewebEdu_hf with Docker Model Runner:
docker model run hf.co/yuchenj/gpt2_774M_100B_FinewebEdu_hf
This is a GPT-2 (774M) model trained in llm.c for 100B tokens with cosine LR on Fineweb-Edu.
A lot more detailed info and observations are here: https://x.com/Yuchenj_UW/status/1814703583453192272