Instructions to use NasimB/gpt2-dp-cl-length with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NasimB/gpt2-dp-cl-length with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NasimB/gpt2-dp-cl-length")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NasimB/gpt2-dp-cl-length") model = AutoModelForCausalLM.from_pretrained("NasimB/gpt2-dp-cl-length") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NasimB/gpt2-dp-cl-length with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NasimB/gpt2-dp-cl-length" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NasimB/gpt2-dp-cl-length", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NasimB/gpt2-dp-cl-length
- SGLang
How to use NasimB/gpt2-dp-cl-length 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 "NasimB/gpt2-dp-cl-length" \ --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": "NasimB/gpt2-dp-cl-length", "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 "NasimB/gpt2-dp-cl-length" \ --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": "NasimB/gpt2-dp-cl-length", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NasimB/gpt2-dp-cl-length with Docker Model Runner:
docker model run hf.co/NasimB/gpt2-dp-cl-length
gpt2-dp-cl-length
This model is a fine-tuned version of gpt2 on the generator dataset. It achieves the following results on the evaluation set:
- Loss: 4.7161
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.0005
- train_batch_size: 64
- eval_batch_size: 64
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 1000
- num_epochs: 7
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 6.6691 | 0.26 | 500 | 5.8270 |
| 5.2775 | 0.53 | 1000 | 5.4588 |
| 4.9444 | 0.79 | 1500 | 5.2410 |
| 4.7094 | 1.05 | 2000 | 5.1417 |
| 4.5245 | 1.31 | 2500 | 4.9932 |
| 4.4306 | 1.58 | 3000 | 4.9406 |
| 4.3594 | 1.84 | 3500 | 4.9073 |
| 4.2194 | 2.1 | 4000 | 4.8631 |
| 4.0996 | 2.36 | 4500 | 4.8316 |
| 4.0865 | 2.63 | 5000 | 4.7686 |
| 4.05 | 2.89 | 5500 | 4.7494 |
| 3.8858 | 3.15 | 6000 | 4.7704 |
| 3.814 | 3.42 | 6500 | 4.6998 |
| 3.8032 | 3.68 | 7000 | 4.6793 |
| 3.7885 | 3.94 | 7500 | 4.6676 |
| 3.5761 | 4.2 | 8000 | 4.6765 |
| 3.5336 | 4.47 | 8500 | 4.6792 |
| 3.535 | 4.73 | 9000 | 4.6749 |
| 3.5307 | 4.99 | 9500 | 4.6553 |
| 3.2929 | 5.25 | 10000 | 4.7027 |
| 3.2874 | 5.52 | 10500 | 4.6926 |
| 3.2883 | 5.78 | 11000 | 4.6927 |
| 3.2606 | 6.04 | 11500 | 4.7025 |
| 3.1356 | 6.31 | 12000 | 4.7098 |
| 3.1392 | 6.57 | 12500 | 4.7123 |
| 3.1374 | 6.83 | 13000 | 4.7161 |
Framework versions
- Transformers 4.26.1
- Pytorch 1.11.0+cu113
- Datasets 2.13.0
- Tokenizers 0.13.3
- Downloads last month
- 5