defunct-datasets/the_pile_openwebtext2
Updated • 225 • 15
How to use nthngdy/headless-pythia-owt2-70m-ft with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="nthngdy/headless-pythia-owt2-70m-ft") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("nthngdy/headless-pythia-owt2-70m-ft")
model = AutoModelForCausalLM.from_pretrained("nthngdy/headless-pythia-owt2-70m-ft")How to use nthngdy/headless-pythia-owt2-70m-ft with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "nthngdy/headless-pythia-owt2-70m-ft"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "nthngdy/headless-pythia-owt2-70m-ft",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/nthngdy/headless-pythia-owt2-70m-ft
How to use nthngdy/headless-pythia-owt2-70m-ft with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "nthngdy/headless-pythia-owt2-70m-ft" \
--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": "nthngdy/headless-pythia-owt2-70m-ft",
"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 "nthngdy/headless-pythia-owt2-70m-ft" \
--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": "nthngdy/headless-pythia-owt2-70m-ft",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use nthngdy/headless-pythia-owt2-70m-ft with Docker Model Runner:
docker model run hf.co/nthngdy/headless-pythia-owt2-70m-ft
This model is a Pythia-70m architecture trained on OpenWebText-2 using the Contrastive Weight Tying objective, and briefly fine-tuned for language generation on the same dataset.
BibTeX:
@misc{godey2023headless,
title={Headless Language Models: Learning without Predicting with Contrastive Weight Tying},
author={Nathan Godey and Éric de la Clergerie and Benoît Sagot},
year={2023},
eprint={2309.08351},
archivePrefix={arXiv},
primaryClass={cs.CL}
}