Text Generation
Transformers
Safetensors
gpt2
causal-lm
from-scratch
reuters
text-generation-inference
Instructions to use MeshMax/gpt2-reuters with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MeshMax/gpt2-reuters with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MeshMax/gpt2-reuters")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MeshMax/gpt2-reuters") model = AutoModelForCausalLM.from_pretrained("MeshMax/gpt2-reuters", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MeshMax/gpt2-reuters with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MeshMax/gpt2-reuters" # 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", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MeshMax/gpt2-reuters
- SGLang
How to use MeshMax/gpt2-reuters 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" \ --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", "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" \ --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", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MeshMax/gpt2-reuters with Docker Model Runner:
docker model run hf.co/MeshMax/gpt2-reuters
Download experiments/small_model/eval_log.csv from MeshMax/gpt2-reuters: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/MeshMax/gpt2-reuters/resolve/main/experiments/small_model/eval_log.csv
- Command line
-
hf download hf://MeshMax/gpt2-reuters/experiments/small_model/eval_log.csv
-
curl -L -o eval_log.csv https://huggingface.co/MeshMax/gpt2-reuters/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.62760066986084,3.2607,484.865,15.334,0.2493150684931507,91 | |
| 6.547333240509033,3.2482,486.737,15.393,0.4986301369863014,182 | |
| 6.074562072753906,3.2434,487.45,15.416,0.7479452054794521,273 | |
| 5.80579948425293,3.2401,487.948,15.432,0.9972602739726028,364 | |
| 5.644709587097168,3.2505,486.381,15.382,1.2465753424657535,455 | |
| 5.524322032928467,3.2522,486.138,15.374,1.4958904109589042,546 | |
| 5.417719841003418,3.2577,485.306,15.348,1.7452054794520548,637 | |
| 5.349903583526611,3.2548,485.747,15.362,1.9945205479452055,728 | |
| 5.282901763916016,3.2568,485.45,15.353,2.243835616438356,819 | |
| 5.237148284912109,3.2581,485.248,15.346,2.493150684931507,910 | |
| 5.1882171630859375,3.2822,481.686,15.234,2.7424657534246575,1001 | |
| 5.15054178237915,3.251,486.314,15.38,2.9917808219178084,1092 | |
| 5.12047815322876,3.2799,482.029,15.244,3.241095890410959,1183 | |
| 5.114963054656982,3.2681,483.764,15.299,3.4904109589041097,1274 | |
| 5.080573558807373,3.2545,485.787,15.363,3.73972602739726,1365 | |
| 5.07025146484375,3.2517,486.202,15.376,3.989041095890411,1456 | |
| 5.06986141204834,3.263,484.529,15.324,4.238356164383561,1547 | |
| 5.068094253540039,3.2449,487.231,15.409,4.487671232876712,1638 | |
| 5.064354419708252,3.254,485.864,15.366,4.736986301369863,1729 | |
| 5.065577507019043,3.2619,484.682,15.328,4.986301369863014,1820 | |
| 5.065572261810303,3.2602,484.944,15.337,5.0,1825 | |