Instructions to use vistagi/gpt2-large-tldr-sum-rlhf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vistagi/gpt2-large-tldr-sum-rlhf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vistagi/gpt2-large-tldr-sum-rlhf")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("vistagi/gpt2-large-tldr-sum-rlhf") model = AutoModelForMultimodalLM.from_pretrained("vistagi/gpt2-large-tldr-sum-rlhf") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use vistagi/gpt2-large-tldr-sum-rlhf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vistagi/gpt2-large-tldr-sum-rlhf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vistagi/gpt2-large-tldr-sum-rlhf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/vistagi/gpt2-large-tldr-sum-rlhf
- SGLang
How to use vistagi/gpt2-large-tldr-sum-rlhf 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 "vistagi/gpt2-large-tldr-sum-rlhf" \ --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": "vistagi/gpt2-large-tldr-sum-rlhf", "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 "vistagi/gpt2-large-tldr-sum-rlhf" \ --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": "vistagi/gpt2-large-tldr-sum-rlhf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use vistagi/gpt2-large-tldr-sum-rlhf with Docker Model Runner:
docker model run hf.co/vistagi/gpt2-large-tldr-sum-rlhf
GPT-2 Large RLHF Model for OpenAI TLDR Summarization
Based on SFT model ellipseai/gpt2-large-tldr-sum and perform RLHF training for better human alignment. The training curve on validation reward is
We perform evaluation for SFT model and RL model on 386 test set on the summarization quality with Claude-v2 to judge winner. We observe that RL model is significantly better than SFT model. This demonstrate that RL training is work very well.
| model | win | loss | tie | win rate | loss rate | win rate adjusted |
|---|---|---|---|---|---|---|
| ellipseai/gpt2-large-tldr-sum | 24 | 151 | 211 | 0.0622 | 0.3911 | 33.55% |
| ellipseai/gpt2-large-tldr-sum-rlhf | 151 | 24 | 211 | 0.3911 | 0.0622 | 66.45% |
- Downloads last month
- 2
