Text Generation
Transformers
Safetensors
llama
alignment
value alignment
AI safety
safety
LLM
history
conversational
text-generation-inference
Instructions to use PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1") model = AutoModelForCausalLM.from_pretrained("PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1
- SGLang
How to use PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1 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 "PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1 with Docker Model Runner:
docker model run hf.co/PKU-Alignment/ProgressGym-HistLlama3-70B-C020-instruct-v0.1
| {"current_steps": 1, "total_steps": 24, "loss": 0.7774, "eval_loss": null, "predict_loss": null, "reward": null, "learning_rate": 0.0, "epoch": 0.041666666666666664, "percentage": 4.17, "elapsed_time": "0:03:08", "remaining_time": "1:12:10"} | |
| {"current_steps": 2, "total_steps": 24, "loss": 0.7324, "eval_loss": null, "predict_loss": null, "reward": null, "learning_rate": 0.0, "epoch": 0.08333333333333333, "percentage": 8.33, "elapsed_time": "0:05:43", "remaining_time": "1:02:57"} | |
| {"current_steps": 4, "total_steps": 24, "loss": 0.873, "eval_loss": null, "predict_loss": null, "reward": null, "learning_rate": 0.0, "epoch": 0.16666666666666666, "percentage": 16.67, "elapsed_time": "0:10:57", "remaining_time": "0:54:48"} | |
| {"current_steps": 6, "total_steps": 24, "loss": 0.8202, "eval_loss": null, "predict_loss": null, "reward": null, "learning_rate": 0.0, "epoch": 0.25, "percentage": 25.0, "elapsed_time": "0:16:21", "remaining_time": "0:49:04"} | |
| {"current_steps": 8, "total_steps": 24, "loss": 0.8623, "eval_loss": null, "predict_loss": null, "reward": null, "learning_rate": 0.0, "epoch": 0.3333333333333333, "percentage": 33.33, "elapsed_time": "0:21:37", "remaining_time": "0:43:15"} | |
| {"current_steps": 10, "total_steps": 24, "loss": 0.8277, "eval_loss": null, "predict_loss": null, "reward": null, "learning_rate": 3e-06, "epoch": 0.4166666666666667, "percentage": 41.67, "elapsed_time": "0:26:51", "remaining_time": "0:37:36"} | |
| {"current_steps": 12, "total_steps": 24, "loss": 0.7238, "eval_loss": null, "predict_loss": null, "reward": null, "learning_rate": 2.7318181818181818e-06, "epoch": 0.5, "percentage": 50.0, "elapsed_time": "0:32:06", "remaining_time": "0:32:06"} | |
| {"current_steps": 14, "total_steps": 24, "loss": 0.6967, "eval_loss": null, "predict_loss": null, "reward": null, "learning_rate": 2.4636363636363635e-06, "epoch": 0.5833333333333334, "percentage": 58.33, "elapsed_time": "0:37:25", "remaining_time": "0:26:44"} | |
| {"current_steps": 16, "total_steps": 24, "loss": 0.6387, "eval_loss": null, "predict_loss": null, "reward": null, "learning_rate": 2.1954545454545456e-06, "epoch": 0.6666666666666666, "percentage": 66.67, "elapsed_time": "0:42:42", "remaining_time": "0:21:21"} | |
| {"current_steps": 18, "total_steps": 24, "loss": 0.5893, "eval_loss": null, "predict_loss": null, "reward": null, "learning_rate": 1.9272727272727273e-06, "epoch": 0.75, "percentage": 75.0, "elapsed_time": "0:47:47", "remaining_time": "0:15:55"} | |
| {"current_steps": 20, "total_steps": 24, "loss": 0.5832, "eval_loss": null, "predict_loss": null, "reward": null, "learning_rate": 1.659090909090909e-06, "epoch": 0.8333333333333334, "percentage": 83.33, "elapsed_time": "0:52:57", "remaining_time": "0:10:35"} | |
| {"current_steps": 22, "total_steps": 24, "loss": 0.6296, "eval_loss": null, "predict_loss": null, "reward": null, "learning_rate": 1.390909090909091e-06, "epoch": 0.9166666666666666, "percentage": 91.67, "elapsed_time": "0:58:08", "remaining_time": "0:05:17"} | |
| {"current_steps": 24, "total_steps": 24, "loss": 0.673, "eval_loss": null, "predict_loss": null, "reward": null, "learning_rate": 1.1227272727272728e-06, "epoch": 1.0, "percentage": 100.0, "elapsed_time": "1:03:26", "remaining_time": "0:00:00"} | |
| {"current_steps": 24, "total_steps": 24, "loss": null, "eval_loss": null, "predict_loss": null, "reward": null, "learning_rate": null, "epoch": 1.0, "percentage": 100.0, "elapsed_time": "1:03:26", "remaining_time": "0:00:00"} | |