Instructions to use jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf") model = AutoModelForCausalLM.from_pretrained("jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf
- SGLang
How to use jtatman/gpt2-open-instruct-v1-Anthropic-hh-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 "jtatman/gpt2-open-instruct-v1-Anthropic-hh-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": "jtatman/gpt2-open-instruct-v1-Anthropic-hh-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 "jtatman/gpt2-open-instruct-v1-Anthropic-hh-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": "jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf with Docker Model Runner:
docker model run hf.co/jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf
Use Docker
docker model run hf.co/jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf
hh-rlhf
This model is a fine-tuned version of vicgalle/gpt2-open-instruct-v1 on an subset (15k) of the Anthropic/hh-rlhf dataset. It achieves the following results on the evaluation set:
- Loss: 2.1534
This model responds to the 'Human:' or 'Assistant:' prompt pretty well in conversation situations.
The shorter responses are better suited. Keep generation length to a reasonable subset. Left to its own devices it will have some pretty esoteric responses.
These include fairly uncensored remarks and at times violent outbursts. Especially if asking questions.
Needs vetting for other textual uses.
Human: Insane clown posse says...
Human: Should we look for a woman?
Assistant: It’s okay if you’re having a tough time finding what you are looking for. It’s a common question people might come up with for an argument or misunderstanding. What are you looking for, and what kind of woman would you have?
Human: Are you trying to find someone to argue
Model description
GPT2 open instruct was trained on the open-instruct dataset fully. The reimagines one LM head as a partial rhlf adapter, with subtle reinforcements.
Intended uses & limitations
Intended to study the intersection of instruct models and prompting that focuses on subtle exchanges of prompting. This probably needs to be refined substantially at this point.
Training and evaluation data
Train dataset size: 15000
Test dataset size: 500
Dataset({
features: ['chosen', 'rejected'],
num_rows: 15000
})
Dataset({
features: ['chosen', 'rejected'],
num_rows: 500
})
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.0005
- train_batch_size: 2
- eval_batch_size: 1
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_steps: 100
- num_epochs: 4
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 2.3108 | 1.0 | 7500 | 2.1799 |
| 2.265 | 2.0 | 15000 | 2.1632 |
| 2.2507 | 3.0 | 22500 | 2.1567 |
| 2.2519 | 4.0 | 30000 | 2.1534 |
Framework versions
- Transformers 4.31.0
- Pytorch 2.0.1+cu118
- Datasets 2.13.1
- Tokenizers 0.13.3
- Downloads last month
- 121
Model tree for jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf
Base model
vicgalle/gpt2-open-instruct-v1
Install from pip and serve model
# Install vLLM from pip: pip install vllm# Start the vLLM server: vllm serve "jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf"# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jtatman/gpt2-open-instruct-v1-Anthropic-hh-rlhf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'