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
Download experiments/small_model/eval_log.csv from MeshMax/gpt2-reuters-from-scratch: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/MeshMax/gpt2-reuters-from-scratch/resolve/main/experiments/small_model/eval_log.csv
- Command line
-
hf download hf://MeshMax/gpt2-reuters-from-scratch/experiments/small_model/eval_log.csv
-
curl -L -o eval_log.csv https://huggingface.co/MeshMax/gpt2-reuters-from-scratch/resolve/main/experiments/small_model/eval_log.csv
1.38 kB
| eval_loss,eval_runtime,eval_samples_per_second,eval_steps_per_second,epoch,step | |
| 7.599363327026367,3.3057,486.731,15.428,0.24797843665768193,92 | |
| 6.51130485534668,3.2819,490.266,15.54,0.49595687331536387,184 | |
| 6.035886287689209,3.3082,486.367,15.416,0.7439353099730458,276 | |
| 5.769773006439209,3.2926,488.673,15.489,0.9919137466307277,368 | |
| 5.606761455535889,3.2908,488.939,15.498,1.2398921832884098,460 | |
| 5.490886211395264,3.2862,489.624,15.519,1.4878706199460916,552 | |
| 5.37647008895874,3.31,486.106,15.408,1.7358490566037736,644 | |
| 5.309648036956787,3.3184,484.879,15.369,1.9838274932614555,736 | |
| 5.246078014373779,3.2946,488.381,15.48,2.2318059299191373,828 | |
| 5.190418243408203,3.3053,486.799,15.43,2.4797843665768196,920 | |
| 5.152101039886475,3.3045,486.911,15.433,2.7277628032345014,1012 | |
| 5.112640857696533,3.3007,487.47,15.451,2.975741239892183,1104 | |
| 5.102231502532959,3.288,489.348,15.511,3.223719676549865,1196 | |
| 5.0694122314453125,3.296,488.173,15.473,3.4716981132075473,1288 | |
| 5.04083251953125,3.2982,487.838,15.463,3.719676549865229,1380 | |
| 5.036014556884766,3.2987,487.775,15.461,3.967654986522911,1472 | |
| 5.025210380554199,3.3054,486.776,15.429,4.215633423180593,1564 | |
| 5.021024227142334,3.2942,488.43,15.482,4.463611859838275,1656 | |
| 5.020303249359131,3.3114,485.892,15.401,4.711590296495957,1748 | |
| 5.02088737487793,3.3061,486.681,15.426,4.959568733153639,1840 | |
| 5.020893096923828,3.3031,487.112,15.44,5.0,1855 | |