Text Generation
Transformers
PyTorch
TensorBoard
gpt2
Generated from Trainer
text-generation-inference
Instructions to use kuttersn/test-clm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kuttersn/test-clm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kuttersn/test-clm")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kuttersn/test-clm") model = AutoModelForCausalLM.from_pretrained("kuttersn/test-clm", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kuttersn/test-clm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kuttersn/test-clm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kuttersn/test-clm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/kuttersn/test-clm
- SGLang
How to use kuttersn/test-clm 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 "kuttersn/test-clm" \ --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": "kuttersn/test-clm", "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 "kuttersn/test-clm" \ --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": "kuttersn/test-clm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use kuttersn/test-clm with Docker Model Runner:
docker model run hf.co/kuttersn/test-clm
Download trainer_state.json from kuttersn/test-clm: direct link, hf CLI and curl.
- Browser
- Download file 2.9 kB
-
https://huggingface.co/kuttersn/test-clm/resolve/main/trainer_state.json
- Command line
-
hf download hf://kuttersn/test-clm/trainer_state.json
-
curl -L -o trainer_state.json https://huggingface.co/kuttersn/test-clm/resolve/main/trainer_state.json
2.9 kB
| { | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 3.0, | |
| "global_step": 9900, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.15, | |
| "learning_rate": 4.7474747474747476e-05, | |
| "loss": 3.8805, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 0.3, | |
| "learning_rate": 4.494949494949495e-05, | |
| "loss": 3.7417, | |
| "step": 1000 | |
| }, | |
| { | |
| "epoch": 0.45, | |
| "learning_rate": 4.242424242424243e-05, | |
| "loss": 3.7075, | |
| "step": 1500 | |
| }, | |
| { | |
| "epoch": 0.61, | |
| "learning_rate": 3.98989898989899e-05, | |
| "loss": 3.6816, | |
| "step": 2000 | |
| }, | |
| { | |
| "epoch": 0.76, | |
| "learning_rate": 3.7373737373737376e-05, | |
| "loss": 3.6595, | |
| "step": 2500 | |
| }, | |
| { | |
| "epoch": 0.91, | |
| "learning_rate": 3.484848484848485e-05, | |
| "loss": 3.6445, | |
| "step": 3000 | |
| }, | |
| { | |
| "epoch": 1.06, | |
| "learning_rate": 3.232323232323233e-05, | |
| "loss": 3.6022, | |
| "step": 3500 | |
| }, | |
| { | |
| "epoch": 1.21, | |
| "learning_rate": 2.9797979797979796e-05, | |
| "loss": 3.5327, | |
| "step": 4000 | |
| }, | |
| { | |
| "epoch": 1.36, | |
| "learning_rate": 2.7272727272727273e-05, | |
| "loss": 3.5349, | |
| "step": 4500 | |
| }, | |
| { | |
| "epoch": 1.52, | |
| "learning_rate": 2.474747474747475e-05, | |
| "loss": 3.548, | |
| "step": 5000 | |
| }, | |
| { | |
| "epoch": 1.67, | |
| "learning_rate": 2.2222222222222223e-05, | |
| "loss": 3.5086, | |
| "step": 5500 | |
| }, | |
| { | |
| "epoch": 1.82, | |
| "learning_rate": 1.9696969696969697e-05, | |
| "loss": 3.5125, | |
| "step": 6000 | |
| }, | |
| { | |
| "epoch": 1.97, | |
| "learning_rate": 1.7171717171717173e-05, | |
| "loss": 3.5208, | |
| "step": 6500 | |
| }, | |
| { | |
| "epoch": 2.12, | |
| "learning_rate": 1.4646464646464647e-05, | |
| "loss": 3.4884, | |
| "step": 7000 | |
| }, | |
| { | |
| "epoch": 2.27, | |
| "learning_rate": 1.2121212121212122e-05, | |
| "loss": 3.4552, | |
| "step": 7500 | |
| }, | |
| { | |
| "epoch": 2.42, | |
| "learning_rate": 9.595959595959595e-06, | |
| "loss": 3.4452, | |
| "step": 8000 | |
| }, | |
| { | |
| "epoch": 2.58, | |
| "learning_rate": 7.0707070707070704e-06, | |
| "loss": 3.46, | |
| "step": 8500 | |
| }, | |
| { | |
| "epoch": 2.73, | |
| "learning_rate": 4.5454545454545455e-06, | |
| "loss": 3.4782, | |
| "step": 9000 | |
| }, | |
| { | |
| "epoch": 2.88, | |
| "learning_rate": 2.0202020202020206e-06, | |
| "loss": 3.4563, | |
| "step": 9500 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "step": 9900, | |
| "total_flos": 1.03471644672e+16, | |
| "train_loss": 3.5661124057962437, | |
| "train_runtime": 7133.7737, | |
| "train_samples_per_second": 2.776, | |
| "train_steps_per_second": 1.388 | |
| } | |
| ], | |
| "max_steps": 9900, | |
| "num_train_epochs": 3, | |
| "total_flos": 1.03471644672e+16, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |