Instructions to use danielkosyra/pretraining2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use danielkosyra/pretraining2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="danielkosyra/pretraining2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("danielkosyra/pretraining2") model = AutoModelForCausalLM.from_pretrained("danielkosyra/pretraining2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use danielkosyra/pretraining2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "danielkosyra/pretraining2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "danielkosyra/pretraining2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/danielkosyra/pretraining2
- SGLang
How to use danielkosyra/pretraining2 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 "danielkosyra/pretraining2" \ --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": "danielkosyra/pretraining2", "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 "danielkosyra/pretraining2" \ --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": "danielkosyra/pretraining2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use danielkosyra/pretraining2 with Docker Model Runner:
docker model run hf.co/danielkosyra/pretraining2
pretraining2
This model is a fine-tuned version of gpt2 on the None dataset. It achieves the following results on the evaluation set:
- Loss: 2.9422
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.0006
- train_batch_size: 32
- eval_batch_size: 32
- seed: 42
- gradient_accumulation_steps: 10
- total_train_batch_size: 320
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_steps: 250
- training_steps: 2500
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 9.1397 | 0.2175 | 50 | 7.4091 |
| 6.757 | 0.4350 | 100 | 6.2515 |
| 5.9876 | 0.6525 | 150 | 5.6981 |
| 5.5149 | 0.8699 | 200 | 5.3046 |
| 5.1426 | 1.0874 | 250 | 4.9651 |
| 4.8103 | 1.3049 | 300 | 4.6788 |
| 4.5283 | 1.5224 | 350 | 4.3959 |
| 4.2857 | 1.7399 | 400 | 4.1092 |
| 4.0192 | 1.9574 | 450 | 3.8204 |
| 3.6955 | 2.1749 | 500 | 3.6372 |
| 3.5727 | 2.3923 | 550 | 3.5295 |
| 3.4683 | 2.6098 | 600 | 3.4383 |
| 3.3902 | 2.8273 | 650 | 3.3732 |
| 3.3098 | 3.0448 | 700 | 3.3121 |
| 3.1593 | 3.2623 | 750 | 3.2721 |
| 3.1308 | 3.4798 | 800 | 3.2269 |
| 3.1069 | 3.6973 | 850 | 3.1956 |
| 3.0803 | 3.9147 | 900 | 3.1640 |
| 2.9617 | 4.1322 | 950 | 3.1332 |
| 2.8995 | 4.3497 | 1000 | 3.1126 |
| 2.884 | 4.5672 | 1050 | 3.0935 |
| 2.8945 | 4.7847 | 1100 | 3.0730 |
| 2.8763 | 5.0022 | 1150 | 3.0494 |
| 2.7005 | 5.2197 | 1200 | 3.0430 |
| 2.7251 | 5.4371 | 1250 | 3.0329 |
| 2.7273 | 5.6546 | 1300 | 3.0171 |
| 2.7144 | 5.8721 | 1350 | 2.9996 |
| 2.6444 | 6.0896 | 1400 | 2.9957 |
| 2.5551 | 6.3071 | 1450 | 2.9925 |
| 2.5775 | 6.5246 | 1500 | 2.9827 |
| 2.5785 | 6.7421 | 1550 | 2.9708 |
| 2.5739 | 6.9595 | 1600 | 2.9620 |
| 2.4375 | 7.1770 | 1650 | 2.9693 |
| 2.4358 | 7.3945 | 1700 | 2.9636 |
| 2.4464 | 7.6120 | 1750 | 2.9571 |
| 2.4438 | 7.8295 | 1800 | 2.9481 |
| 2.4174 | 8.0470 | 1850 | 2.9503 |
| 2.293 | 8.2645 | 1900 | 2.9542 |
| 2.3206 | 8.4819 | 1950 | 2.9506 |
| 2.3349 | 8.6994 | 2000 | 2.9446 |
| 2.3229 | 8.9169 | 2050 | 2.9389 |
| 2.2456 | 9.1344 | 2100 | 2.9491 |
| 2.2139 | 9.3519 | 2150 | 2.9477 |
| 2.2132 | 9.5694 | 2200 | 2.9455 |
| 2.2187 | 9.7869 | 2250 | 2.9416 |
| 2.206 | 10.0043 | 2300 | 2.9382 |
| 2.1139 | 10.2218 | 2350 | 2.9456 |
| 2.1322 | 10.4393 | 2400 | 2.9459 |
| 2.134 | 10.6568 | 2450 | 2.9434 |
| 2.1264 | 10.8743 | 2500 | 2.9422 |
Framework versions
- Transformers 4.40.1
- Pytorch 2.3.0+cu121
- Datasets 2.19.0
- Tokenizers 0.19.1
- Downloads last month
- 8
Model tree for danielkosyra/pretraining2
Base model
openai-community/gpt2