Text Generation
Transformers
Safetensors
English
gpt2
Microsoft
ChatBench
Interactive Benchmark
User Simulator
Benchmarking
text-generation-inference
Instructions to use microsoft/chatbench-distilgpt2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/chatbench-distilgpt2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="microsoft/chatbench-distilgpt2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("microsoft/chatbench-distilgpt2") model = AutoModelForCausalLM.from_pretrained("microsoft/chatbench-distilgpt2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use microsoft/chatbench-distilgpt2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "microsoft/chatbench-distilgpt2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "microsoft/chatbench-distilgpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/microsoft/chatbench-distilgpt2
- SGLang
How to use microsoft/chatbench-distilgpt2 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 "microsoft/chatbench-distilgpt2" \ --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": "microsoft/chatbench-distilgpt2", "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 "microsoft/chatbench-distilgpt2" \ --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": "microsoft/chatbench-distilgpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use microsoft/chatbench-distilgpt2 with Docker Model Runner:
docker model run hf.co/microsoft/chatbench-distilgpt2
Download checkpoint-780/trainer_state.json from microsoft/chatbench-distilgpt2: direct link, hf CLI and curl.
- Browser
- Download file 2.25 kB
-
https://huggingface.co/microsoft/chatbench-distilgpt2/resolve/main/checkpoint-780/trainer_state.json
- Command line
-
hf download hf://microsoft/chatbench-distilgpt2/checkpoint-780/trainer_state.json
-
curl -L -o trainer_state.json https://huggingface.co/microsoft/chatbench-distilgpt2/resolve/main/checkpoint-780/trainer_state.json
2.25 kB
| { | |
| "best_global_step": 780, | |
| "best_metric": 1.4478473663330078, | |
| "best_model_checkpoint": "results/models/distilgpt2_split_3/checkpoint-780", | |
| "epoch": 1.0, | |
| "eval_steps": 500, | |
| "global_step": 780, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.1282051282051282, | |
| "grad_norm": 2.1318576335906982, | |
| "learning_rate": 4.689102564102564e-05, | |
| "loss": 1.8462, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.2564102564102564, | |
| "grad_norm": 1.8293204307556152, | |
| "learning_rate": 4.368589743589744e-05, | |
| "loss": 1.5051, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 0.38461538461538464, | |
| "grad_norm": 2.407285690307617, | |
| "learning_rate": 4.0480769230769236e-05, | |
| "loss": 1.4097, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 0.5128205128205128, | |
| "grad_norm": 2.0177223682403564, | |
| "learning_rate": 3.727564102564103e-05, | |
| "loss": 1.3136, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 0.6410256410256411, | |
| "grad_norm": 1.5830180644989014, | |
| "learning_rate": 3.4070512820512825e-05, | |
| "loss": 1.2698, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 0.7692307692307693, | |
| "grad_norm": 1.6503092050552368, | |
| "learning_rate": 3.0865384615384616e-05, | |
| "loss": 1.2133, | |
| "step": 600 | |
| }, | |
| { | |
| "epoch": 0.8974358974358975, | |
| "grad_norm": 1.608035922050476, | |
| "learning_rate": 2.7660256410256413e-05, | |
| "loss": 1.1817, | |
| "step": 700 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "eval_loss": 1.4478473663330078, | |
| "eval_runtime": 14.1171, | |
| "eval_samples_per_second": 370.259, | |
| "eval_steps_per_second": 23.163, | |
| "step": 780 | |
| } | |
| ], | |
| "logging_steps": 100, | |
| "max_steps": 1560, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 2, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": false | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 3260983447388160.0, | |
| "train_batch_size": 4, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |