HuggingFaceFW/fineweb
Viewer • Updated • 52.5B • 1.07M • 2.85k
How to use rhysjones/gpt2-774M-fineweb-150B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="rhysjones/gpt2-774M-fineweb-150B", trust_remote_code=True) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("rhysjones/gpt2-774M-fineweb-150B", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("rhysjones/gpt2-774M-fineweb-150B", trust_remote_code=True)How to use rhysjones/gpt2-774M-fineweb-150B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "rhysjones/gpt2-774M-fineweb-150B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "rhysjones/gpt2-774M-fineweb-150B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/rhysjones/gpt2-774M-fineweb-150B
How to use rhysjones/gpt2-774M-fineweb-150B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "rhysjones/gpt2-774M-fineweb-150B" \
--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": "rhysjones/gpt2-774M-fineweb-150B",
"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 "rhysjones/gpt2-774M-fineweb-150B" \
--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": "rhysjones/gpt2-774M-fineweb-150B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use rhysjones/gpt2-774M-fineweb-150B with Docker Model Runner:
docker model run hf.co/rhysjones/gpt2-774M-fineweb-150B
This is karpathy's model from the llm.c project converted to HF format to investigate bfloat16 performance.
The training run was 150B tokens, 1.5 epochs over the 100B FineWeb sample dataset.
There's active work underway at https://github.com/karpathy/llm.c so I'd suggest following the developments there!