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/epochs_2/train_log.csv from MeshMax/gpt2-reuters: direct link, hf CLI and curl.
- Browser
- Download file 1.76 kB
-
https://huggingface.co/MeshMax/gpt2-reuters/resolve/main/experiments/epochs_2/train_log.csv
- Command line
-
hf download hf://MeshMax/gpt2-reuters/experiments/epochs_2/train_log.csv
-
curl -L -o train_log.csv https://huggingface.co/MeshMax/gpt2-reuters/resolve/main/experiments/epochs_2/train_log.csv
1.76 kB
| loss,grad_norm,learning_rate,epoch,step | |
| 10.843499183654785,4.1243085861206055,0.0,0.0027397260273972603,1 | |
| 9.616796003069197,1.6109970808029175,0.0004861111111111111,0.09863013698630137,36 | |
| 7.004016452365452,0.5868044495582581,0.0004968687465157165,0.19726027397260273,72 | |
| 6.300339168972439,0.5451584458351135,0.0004871983554619603,0.2958904109589041,108 | |
| 5.9771313137478295,0.6023691892623901,0.00047124251808455087,0.39452054794520547,144 | |
| 5.788884904649523,0.7368696928024292,0.00044942404321447407,0.4931506849315068,180 | |
| 5.627533806694879,0.8528636693954468,0.00042232109191188026,0.5917808219178082,216 | |
| 5.507063547770183,0.6476799249649048,0.0003906518569538371,0.6904109589041096,252 | |
| 5.4260508219401045,0.6880940794944763,0.0003552555316646499,0.7890410958904109,288 | |
| 5.302911122639974,0.8764607906341553,0.00031707007238986973,0.8876712328767123,324 | |
| 5.214031643337673,0.7636662125587463,0.00027710734387935204,0.9863013698630136,360 | |
| 5.108998616536458,0.7660359144210815,0.0002364263061942254,1.084931506849315,396 | |
| 5.073592715793186,0.7230262756347656,0.00019610495364967968,1.1835616438356165,432 | |
| 5.007653130425347,0.6248455047607422,0.00015721174937490583,1.2821917808219179,468 | |
| 4.989662594265408,0.7315065264701843,0.00012077731243700449,1.3808219178082193,504 | |
| 4.965666876898871,0.7256110906600952,8.776710778306462e-05,1.4794520547945205,540 | |
| 4.954546610514323,0.6726171970367432,5.90558626812458e-05,1.5780821917808219,576 | |
| 4.903006235758464,0.6890636086463928,3.5404387591726924e-05,1.6767123287671233,612 | |
| 4.910601298014323,0.7246794104576111,1.7439415684141063e-05,1.7753424657534247,648 | |
| 4.909825219048394,0.6434288024902344,5.636995227925601e-06,1.8739726027397259,684 | |
| 4.905776129828559,0.588848888874054,3.098749355336938e-07,1.9726027397260273,720 | |