EleutherAI/bergson-wikitext-512-chunks
Viewer • Updated • 4.86k
How to use EleutherAI/GPT-2-wikitext-chunks with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="EleutherAI/GPT-2-wikitext-chunks") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("EleutherAI/GPT-2-wikitext-chunks")
model = AutoModelForCausalLM.from_pretrained("EleutherAI/GPT-2-wikitext-chunks")How to use EleutherAI/GPT-2-wikitext-chunks with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "EleutherAI/GPT-2-wikitext-chunks"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "EleutherAI/GPT-2-wikitext-chunks",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/EleutherAI/GPT-2-wikitext-chunks
How to use EleutherAI/GPT-2-wikitext-chunks with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "EleutherAI/GPT-2-wikitext-chunks" \
--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": "EleutherAI/GPT-2-wikitext-chunks",
"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 "EleutherAI/GPT-2-wikitext-chunks" \
--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": "EleutherAI/GPT-2-wikitext-chunks",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use EleutherAI/GPT-2-wikitext-chunks with Docker Model Runner:
docker model run hf.co/EleutherAI/GPT-2-wikitext-chunks
GPT-2 (124M) fine-tuned on EleutherAI/bergson-wikitext-512-chunks (WikiText-2 pre-chunked to 512-token sequences, 4,608 train chunks) using the bergson MAGIC trainer, as the trained model for MAGIC attribution experiments.
test[:4] chunks: 3.22 (base gpt2: 3.62)bergson_config.yaml — the fully-resolved bergson run config (all fields incl. defaults) that produced this model; rerun with python -m bergson bergson_config.yamloptimizer.pt — AdamW second moments (exp_avg_sq) at the final training
step, in bergson's optimizer.pt normalizer format
({"state": {idx: {"exp_avg_sq": ...}}, "param_groups": [...]} with idx
indexing deduplicated model.named_parameters()), for gradient
normalization in attribution runs.