Instructions to use sgolkar/gpt2-medium-finetuned-brookstraining with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sgolkar/gpt2-medium-finetuned-brookstraining with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sgolkar/gpt2-medium-finetuned-brookstraining")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sgolkar/gpt2-medium-finetuned-brookstraining") model = AutoModelForCausalLM.from_pretrained("sgolkar/gpt2-medium-finetuned-brookstraining") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sgolkar/gpt2-medium-finetuned-brookstraining with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sgolkar/gpt2-medium-finetuned-brookstraining" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sgolkar/gpt2-medium-finetuned-brookstraining", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sgolkar/gpt2-medium-finetuned-brookstraining
- SGLang
How to use sgolkar/gpt2-medium-finetuned-brookstraining 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 "sgolkar/gpt2-medium-finetuned-brookstraining" \ --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": "sgolkar/gpt2-medium-finetuned-brookstraining", "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 "sgolkar/gpt2-medium-finetuned-brookstraining" \ --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": "sgolkar/gpt2-medium-finetuned-brookstraining", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use sgolkar/gpt2-medium-finetuned-brookstraining with Docker Model Runner:
docker model run hf.co/sgolkar/gpt2-medium-finetuned-brookstraining
gpt2-medium-finetuned-brookstraining
This model is a fine-tuned version of gpt2-medium on the None dataset. It achieves the following results on the evaluation set:
- Loss: 4.8470
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: 5e-05
- train_batch_size: 8
- eval_batch_size: 8
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 20
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| No log | 1.0 | 100 | 3.4632 |
| No log | 2.0 | 200 | 3.4360 |
| No log | 3.0 | 300 | 3.4539 |
| No log | 4.0 | 400 | 3.4867 |
| 3.2934 | 5.0 | 500 | 3.5341 |
| 3.2934 | 6.0 | 600 | 3.6145 |
| 3.2934 | 7.0 | 700 | 3.6938 |
| 3.2934 | 8.0 | 800 | 3.8198 |
| 3.2934 | 9.0 | 900 | 3.9274 |
| 2.2258 | 10.0 | 1000 | 4.0388 |
| 2.2258 | 11.0 | 1100 | 4.1807 |
| 2.2258 | 12.0 | 1200 | 4.2635 |
| 2.2258 | 13.0 | 1300 | 4.3549 |
| 2.2258 | 14.0 | 1400 | 4.5134 |
| 1.5305 | 15.0 | 1500 | 4.5719 |
| 1.5305 | 16.0 | 1600 | 4.6932 |
| 1.5305 | 17.0 | 1700 | 4.7392 |
| 1.5305 | 18.0 | 1800 | 4.7729 |
| 1.5305 | 19.0 | 1900 | 4.8324 |
| 1.1988 | 20.0 | 2000 | 4.8470 |
Framework versions
- Transformers 4.27.4
- Pytorch 1.13.1
- Datasets 2.11.0
- Tokenizers 0.11.0
- Downloads last month
- 6