Text Generation
Transformers
Safetensors
Japanese
gpt2
Generated from Trainer
text-generation-inference
Instructions to use vericava/gpt2-medium-vericava-posts-v3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vericava/gpt2-medium-vericava-posts-v3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vericava/gpt2-medium-vericava-posts-v3")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("vericava/gpt2-medium-vericava-posts-v3") model = AutoModelForCausalLM.from_pretrained("vericava/gpt2-medium-vericava-posts-v3") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use vericava/gpt2-medium-vericava-posts-v3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vericava/gpt2-medium-vericava-posts-v3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vericava/gpt2-medium-vericava-posts-v3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/vericava/gpt2-medium-vericava-posts-v3
- SGLang
How to use vericava/gpt2-medium-vericava-posts-v3 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 "vericava/gpt2-medium-vericava-posts-v3" \ --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": "vericava/gpt2-medium-vericava-posts-v3", "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 "vericava/gpt2-medium-vericava-posts-v3" \ --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": "vericava/gpt2-medium-vericava-posts-v3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use vericava/gpt2-medium-vericava-posts-v3 with Docker Model Runner:
docker model run hf.co/vericava/gpt2-medium-vericava-posts-v3
gpt2-medium-vericava-posts-v3
This is a model trained from scratch using the shape of gpt2-medium on a dataset of my posts on the Internet.
It achieves the following results on the evaluation set:
- Loss: 6.4732
Model description
It generates text resembling what I post on the Internet.
Intended uses & limitations
CAUTION: It may produce something I'd never say. I do not impose any restriction(s) on the use of this model.
Training and evaluation data
Twitter/X: https://x.com/vericava
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 0.0005
- train_batch_size: 128
- eval_batch_size: 128
- seed: 42
- gradient_accumulation_steps: 8
- total_train_batch_size: 1024
- optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 1000
- num_epochs: 100
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 2.1117 | 11.1176 | 100 | 6.5645 |
| 1.461 | 22.2353 | 200 | 5.6692 |
| 1.3005 | 33.3529 | 300 | 5.3980 |
| 1.1776 | 44.4706 | 400 | 5.2793 |
| 1.0325 | 55.5882 | 500 | 5.3445 |
| 0.8629 | 66.7059 | 600 | 5.5766 |
| 0.6811 | 77.8235 | 700 | 5.8608 |
| 0.4943 | 88.9412 | 800 | 6.1404 |
| 0.3243 | 100.0 | 900 | 6.4732 |
Framework versions
- Transformers 4.52.4
- Pytorch 2.6.0+cu124
- Datasets 3.6.0
- Tokenizers 0.21.1
- Downloads last month
- -