Text Generation
Transformers
Safetensors
gpt2
causal-lm
from-scratch
reuters
text-generation-inference
Instructions to use MeshMax/gpt2-reuters-from-scratch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MeshMax/gpt2-reuters-from-scratch with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MeshMax/gpt2-reuters-from-scratch")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MeshMax/gpt2-reuters-from-scratch") model = AutoModelForCausalLM.from_pretrained("MeshMax/gpt2-reuters-from-scratch", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MeshMax/gpt2-reuters-from-scratch with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MeshMax/gpt2-reuters-from-scratch" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MeshMax/gpt2-reuters-from-scratch", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MeshMax/gpt2-reuters-from-scratch
- SGLang
How to use MeshMax/gpt2-reuters-from-scratch 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 "MeshMax/gpt2-reuters-from-scratch" \ --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": "MeshMax/gpt2-reuters-from-scratch", "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 "MeshMax/gpt2-reuters-from-scratch" \ --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": "MeshMax/gpt2-reuters-from-scratch", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MeshMax/gpt2-reuters-from-scratch with Docker Model Runner:
docker model run hf.co/MeshMax/gpt2-reuters-from-scratch
File size: 1,385 Bytes
180ee67 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | eval_loss,eval_runtime,eval_samples_per_second,eval_steps_per_second,epoch,step
6.632839202880859,4.4053,365.244,11.577,0.24797843665768193,92
5.807225704193115,4.4901,358.347,11.358,0.49595687331536387,184
5.488468170166016,4.6135,348.757,11.054,0.7439353099730458,276
5.225056171417236,4.67,344.542,10.921,0.9919137466307277,368
5.0623250007629395,4.5419,354.261,11.229,1.2398921832884098,460
4.937719821929932,4.5329,354.961,11.251,1.4878706199460916,552
4.830669403076172,4.5811,351.228,11.133,1.7358490566037736,644
4.7306227684021,4.5953,350.142,11.098,1.9838274932614555,736
4.672943592071533,4.5844,350.975,11.125,2.2318059299191373,828
4.609096527099609,4.5749,351.698,11.148,2.4797843665768196,920
4.551987648010254,4.5653,352.441,11.171,2.7277628032345014,1012
4.502364158630371,4.5894,350.59,11.113,2.975741239892183,1104
4.4746904373168945,4.5991,349.854,11.089,3.223719676549865,1196
4.447484016418457,4.5939,350.244,11.102,3.4716981132075473,1288
4.419970512390137,4.5947,350.184,11.1,3.719676549865229,1380
4.399313449859619,4.602,349.632,11.082,3.967654986522911,1472
4.393060207366943,4.5886,350.652,11.115,4.215633423180593,1564
4.385672092437744,4.6177,348.441,11.044,4.463611859838275,1656
4.381003379821777,4.5923,350.373,11.106,4.711590296495957,1748
4.380158424377441,4.592,350.394,11.106,4.959568733153639,1840
4.380163192749023,4.5714,351.972,11.156,5.0,1855
|