Instructions to use NasimB/gpt2-dp-cl-length-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NasimB/gpt2-dp-cl-length-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NasimB/gpt2-dp-cl-length-2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NasimB/gpt2-dp-cl-length-2") model = AutoModelForCausalLM.from_pretrained("NasimB/gpt2-dp-cl-length-2") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use NasimB/gpt2-dp-cl-length-2 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-2" # 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-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NasimB/gpt2-dp-cl-length-2
- SGLang
How to use NasimB/gpt2-dp-cl-length-2 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-2" \ --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-2", "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-2" \ --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-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NasimB/gpt2-dp-cl-length-2 with Docker Model Runner:
docker model run hf.co/NasimB/gpt2-dp-cl-length-2
gpt2-dp-cl-length-2
This model is a fine-tuned version of gpt2 on the generator dataset. It achieves the following results on the evaluation set:
- Loss: 4.6978
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.7438 | 0.28 | 500 | 5.8628 |
| 5.3832 | 0.57 | 1000 | 5.4721 |
| 5.0548 | 0.85 | 1500 | 5.2463 |
| 4.7966 | 1.14 | 2000 | 5.0887 |
| 4.6482 | 1.42 | 2500 | 4.9869 |
| 4.5475 | 1.7 | 3000 | 4.9166 |
| 4.4753 | 1.99 | 3500 | 4.8238 |
| 4.2612 | 2.27 | 4000 | 4.8195 |
| 4.2415 | 2.56 | 4500 | 4.7798 |
| 4.2024 | 2.84 | 5000 | 4.7139 |
| 4.0709 | 3.12 | 5500 | 4.7122 |
| 3.9548 | 3.41 | 6000 | 4.7128 |
| 3.9485 | 3.69 | 6500 | 4.6607 |
| 3.9265 | 3.98 | 7000 | 4.6461 |
| 3.687 | 4.26 | 7500 | 4.6674 |
| 3.6784 | 4.54 | 8000 | 4.6577 |
| 3.6665 | 4.83 | 8500 | 4.6403 |
| 3.5603 | 5.11 | 9000 | 4.6735 |
| 3.4226 | 5.39 | 9500 | 4.6843 |
| 3.4158 | 5.68 | 10000 | 4.6834 |
| 3.4077 | 5.96 | 10500 | 4.6679 |
| 3.2813 | 6.25 | 11000 | 4.6955 |
| 3.2684 | 6.53 | 11500 | 4.6982 |
| 3.2599 | 6.81 | 12000 | 4.6978 |
Framework versions
- Transformers 4.26.1
- Pytorch 1.11.0+cu113
- Datasets 2.13.0
- Tokenizers 0.13.3
- Downloads last month
- 4