Instructions to use van-ng/gpt2-XYZCompany-1000-steps with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use van-ng/gpt2-XYZCompany-1000-steps with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="van-ng/gpt2-XYZCompany-1000-steps")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("van-ng/gpt2-XYZCompany-1000-steps") model = AutoModelForCausalLM.from_pretrained("van-ng/gpt2-XYZCompany-1000-steps", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use van-ng/gpt2-XYZCompany-1000-steps with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "van-ng/gpt2-XYZCompany-1000-steps" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "van-ng/gpt2-XYZCompany-1000-steps", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/van-ng/gpt2-XYZCompany-1000-steps
- SGLang
How to use van-ng/gpt2-XYZCompany-1000-steps 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 "van-ng/gpt2-XYZCompany-1000-steps" \ --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": "van-ng/gpt2-XYZCompany-1000-steps", "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 "van-ng/gpt2-XYZCompany-1000-steps" \ --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": "van-ng/gpt2-XYZCompany-1000-steps", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use van-ng/gpt2-XYZCompany-1000-steps with Docker Model Runner:
docker model run hf.co/van-ng/gpt2-XYZCompany-1000-steps
gpt2-XYZCompany-1000-steps
This model is a fine-tuned version of gpt2 on an unknown dataset. It achieves the following results on the evaluation set:
- Loss: 0.3082
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: 1e-05
- train_batch_size: 8
- eval_batch_size: 4
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_steps: 1
- training_steps: 1000
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.4688 | 0.32 | 50 | 0.4117 |
| 0.4546 | 0.63 | 100 | 0.3712 |
| 0.3868 | 0.95 | 150 | 0.3539 |
| 0.369 | 1.27 | 200 | 0.3427 |
| 0.3572 | 1.58 | 250 | 0.3357 |
| 0.344 | 1.9 | 300 | 0.3301 |
| 0.343 | 2.22 | 350 | 0.3258 |
| 0.348 | 2.53 | 400 | 0.3227 |
| 0.3431 | 2.85 | 450 | 0.3194 |
| 0.2994 | 3.16 | 500 | 0.3169 |
| 0.3348 | 3.48 | 550 | 0.3155 |
| 0.3177 | 3.8 | 600 | 0.3134 |
| 0.32 | 4.11 | 650 | 0.3125 |
| 0.318 | 4.43 | 700 | 0.3111 |
| 0.3448 | 4.75 | 750 | 0.3102 |
| 0.2903 | 5.06 | 800 | 0.3094 |
| 0.3078 | 5.38 | 850 | 0.3088 |
| 0.2993 | 5.7 | 900 | 0.3085 |
| 0.3132 | 6.01 | 950 | 0.3083 |
| 0.3262 | 6.33 | 1000 | 0.3082 |
Framework versions
- Transformers 4.32.1
- Pytorch 2.1.2
- Datasets 2.17.1
- Tokenizers 0.13.2
- Downloads last month
- 10
Model tree for van-ng/gpt2-XYZCompany-1000-steps
Base model
openai-community/gpt2