Instructions to use NasimB/gpt2-dp-mod_aochild with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NasimB/gpt2-dp-mod_aochild with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NasimB/gpt2-dp-mod_aochild")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NasimB/gpt2-dp-mod_aochild") model = AutoModelForCausalLM.from_pretrained("NasimB/gpt2-dp-mod_aochild") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NasimB/gpt2-dp-mod_aochild with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NasimB/gpt2-dp-mod_aochild" # 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-mod_aochild", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NasimB/gpt2-dp-mod_aochild
- SGLang
How to use NasimB/gpt2-dp-mod_aochild 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-mod_aochild" \ --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-mod_aochild", "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-mod_aochild" \ --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-mod_aochild", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NasimB/gpt2-dp-mod_aochild with Docker Model Runner:
docker model run hf.co/NasimB/gpt2-dp-mod_aochild
gpt2-dp-mod_aochild
This model is a fine-tuned version of gpt2 on the generator dataset. It achieves the following results on the evaluation set:
- Loss: 4.4146
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: 10
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 6.706 | 0.27 | 500 | 5.6466 |
| 5.3616 | 0.54 | 1000 | 5.2058 |
| 5.0148 | 0.81 | 1500 | 4.9571 |
| 4.7595 | 1.08 | 2000 | 4.8100 |
| 4.5716 | 1.35 | 2500 | 4.6947 |
| 4.4792 | 1.62 | 3000 | 4.5951 |
| 4.3985 | 1.89 | 3500 | 4.5126 |
| 4.2203 | 2.16 | 4000 | 4.4747 |
| 4.1373 | 2.42 | 4500 | 4.4206 |
| 4.1109 | 2.69 | 5000 | 4.3695 |
| 4.0827 | 2.96 | 5500 | 4.3285 |
| 3.8662 | 3.23 | 6000 | 4.3409 |
| 3.863 | 3.5 | 6500 | 4.3058 |
| 3.8585 | 3.77 | 7000 | 4.2777 |
| 3.8073 | 4.04 | 7500 | 4.2766 |
| 3.594 | 4.31 | 8000 | 4.2886 |
| 3.6275 | 4.58 | 8500 | 4.2700 |
| 3.6373 | 4.85 | 9000 | 4.2436 |
| 3.488 | 5.12 | 9500 | 4.2800 |
| 3.3669 | 5.39 | 10000 | 4.2884 |
| 3.3981 | 5.66 | 10500 | 4.2764 |
| 3.3991 | 5.93 | 11000 | 4.2533 |
| 3.177 | 6.2 | 11500 | 4.3110 |
| 3.1321 | 6.47 | 12000 | 4.3137 |
| 3.1491 | 6.73 | 12500 | 4.3083 |
| 3.1544 | 7.0 | 13000 | 4.3112 |
| 2.8924 | 7.27 | 13500 | 4.3587 |
| 2.9109 | 7.54 | 14000 | 4.3634 |
| 2.9185 | 7.81 | 14500 | 4.3600 |
| 2.8619 | 8.08 | 15000 | 4.3819 |
| 2.7347 | 8.35 | 15500 | 4.3980 |
| 2.7435 | 8.62 | 16000 | 4.4007 |
| 2.752 | 8.89 | 16500 | 4.4012 |
| 2.6887 | 9.16 | 17000 | 4.4116 |
| 2.6506 | 9.43 | 17500 | 4.4137 |
| 2.6588 | 9.7 | 18000 | 4.4144 |
| 2.66 | 9.97 | 18500 | 4.4146 |
Framework versions
- Transformers 4.26.1
- Pytorch 1.11.0+cu113
- Datasets 2.13.0
- Tokenizers 0.13.3
- Downloads last month
- 7