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 train_log.csv from MeshMax/gpt2-reuters: direct link, hf CLI and curl.
- Browser
- Download file 4.22 kB
-
https://huggingface.co/MeshMax/gpt2-reuters/resolve/main/train_log.csv
- Command line
-
hf download hf://MeshMax/gpt2-reuters/train_log.csv
-
curl -L -o train_log.csv https://huggingface.co/MeshMax/gpt2-reuters/resolve/main/train_log.csv
4.22 kB
| loss,grad_norm,learning_rate,epoch,step | |
| 10.843499183654785,4.1243085861206055,0.0,0.0027397260273972603,1 | |
| 10.112830461774553,1.6889289617538452,0.00019230769230769233,0.09863013698630137,36 | |
| 8.122010125054253,1.1631869077682495,0.0003901098901098901,0.19726027397260273,72 | |
| 6.626266055636936,0.7652581334114075,0.0004998949681233594,0.2958904109589041,108 | |
| 6.1394458346896705,0.5927463173866272,0.0004988913434959838,0.39452054794520547,144 | |
| 5.871527777777778,0.8243330717086792,0.00049682928826997,0.4931506849315068,180 | |
| 5.672797309027778,0.7401215434074402,0.0004937175715021947,0.5917808219178082,216 | |
| 5.533193800184462,0.6174284219741821,0.0004895694260202649,0.6904109589041096,252 | |
| 5.439222123887804,0.6852076053619385,0.0004844024921488459,0.7890410958904109,288 | |
| 5.29977544148763,0.8661860227584839,0.0004782387426927524,0.8876712328767123,324 | |
| 5.191475762261285,1.1850008964538574,0.0004711043894958153,0.9863013698630136,360 | |
| 5.067947811550564,0.7524315714836121,0.00046302977197289387,1.084931506849315,396 | |
| 5.013914320203993,0.6935922503471375,0.00045404922808905544,1.1835616438356165,432 | |
| 4.934565650092231,0.9684600234031677,0.0004442009483345982,1.2821917808219179,468 | |
| 4.8912811279296875,0.8014423251152039,0.0004335268133168974,1.3808219178082193,504 | |
| 4.848009745279948,0.7951119542121887,0.0004220722156597303,1.4794520547945205,540 | |
| 4.818994310167101,0.8276904821395874,0.0004098858669674667,1.5780821917808219,576 | |
| 4.738659328884548,0.8503921627998352,0.00039701959067502563,1.6767123287671233,612 | |
| 4.714195251464844,0.7272070050239563,0.00038352810166452056,1.7753424657534247,648 | |
| 4.686511569552952,0.807900071144104,0.00036946877358579137,1.8739726027397259,684 | |
| 4.649570041232639,0.9024501442909241,0.0003549013948703109,1.9726027397260273,720 | |
| 4.519972483317058,0.8987959027290344,0.0003398879144760376,2.0712328767123287,756 | |
| 4.509351942274305,0.7781643271446228,0.00032449217844445345,2.16986301369863,792 | |
| 4.487845526801215,0.8497344255447388,0.00030877965839010103,2.2684931506849315,828 | |
| 4.466296725802952,0.8149892091751099,0.0002928171730772399,2.367123287671233,864 | |
| 4.440130445692274,0.8337175250053406,0.0002766726042676383,2.4657534246575343,900 | |
| 4.41022703382704,0.8579709529876709,0.00026041460804788384,2.5643835616438357,936 | |
| 4.394260406494141,0.8682076334953308,0.0002441123228638132,2.663013698630137,972 | |
| 4.381738026936849,0.8846184015274048,0.00022783507550367128,2.7616438356164386,1008 | |
| 4.330888960096571,0.863422155380249,0.0002116520862803286,2.86027397260274,1044 | |
| 4.3516955905490455,0.8624801635742188,0.0001956321746662943,2.958904109589041,1080 | |
| 4.260430230034722,0.885055661201477,0.00017984346663333414,3.0575342465753423,1116 | |
| 4.224758148193359,0.8201701641082764,0.00016435310494125765,3.1561643835616437,1152 | |
| 4.217038472493489,0.9674780964851379,0.00014922696360789367,3.254794520547945,1188 | |
| 4.214850107828776,0.8887249827384949,0.00013452936777449333,3.3534246575342466,1224 | |
| 4.199208577473958,0.8431931734085083,0.00012032282015785648,3.452054794520548,1260 | |
| 4.194234636094835,0.8109630942344666,0.00010666773525246593,3.5506849315068494,1296 | |
| 4.173423767089844,0.824052631855011,9.3622182412956e-05,3.649315068493151,1332 | |
| 4.164979298909505,0.8272960782051086,8.12416389094783e-05,3.747945205479452,1368 | |
| 4.153656005859375,0.8214993476867676,6.957875400611635e-05,3.846575342465753,1404 | |
| 4.1470531887478295,0.7929672598838806,5.8683125065625845e-05,3.9452054794520546,1440 | |
| 4.135826958550347,0.8295363783836365,4.860108663263185e-05,4.043835616438356,1476 | |
| 4.068011813693577,0.7826312780380249,3.937551339222484e-05,4.142465753424657,1512 | |
| 4.1022288004557295,0.7662568092346191,3.104563784188938e-05,4.241095890410959,1548 | |
| 4.075099945068359,0.9123141169548035,2.3646883452130618e-05,4.33972602739726,1584 | |
| 4.086168924967448,0.7931163311004639,1.7210714025296754e-05,4.438356164383562,1620 | |
| 4.08806652492947,0.7995381355285645,1.1764499893210877e-05,4.536986301369863,1656 | |
| 4.082679324679905,0.7690331339836121,7.331401522617881e-06,4.635616438356164,1692 | |
| 4.071108500162761,0.8010034561157227,3.9302710234236375e-06,4.734246575342466,1728 | |
| 4.081999884711371,0.7422578930854797,1.575571978570639e-06,4.832876712328767,1764 | |
| 4.100735134548611,0.7359047532081604,2.773179364798095e-07,4.931506849315069,1800 | |