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/train_log.csv from MeshMax/gpt2-reuters: direct link, hf CLI and curl.
- Browser
- Download file 4.23 kB
-
https://huggingface.co/MeshMax/gpt2-reuters/resolve/main/experiments/small_model/train_log.csv
- Command line
-
hf download hf://MeshMax/gpt2-reuters/experiments/small_model/train_log.csv
-
curl -L -o train_log.csv https://huggingface.co/MeshMax/gpt2-reuters/resolve/main/experiments/small_model/train_log.csv
4.23 kB
| loss,grad_norm,learning_rate,epoch,step | |
| 10.844676971435547,1.5861732959747314,0.0,0.0027397260273972603,1 | |
| 10.550105503627233,1.1891223192214966,0.00019230769230769233,0.09863013698630137,36 | |
| 9.31990475124783,1.1891051530838013,0.0003901098901098901,0.19726027397260273,72 | |
| 7.708494398328993,0.8557033538818359,0.0004998949681233594,0.2958904109589041,108 | |
| 6.947506798638238,0.41468554735183716,0.0004988913434959838,0.39452054794520547,144 | |
| 6.654604593912761,0.44966909289360046,0.00049682928826997,0.4931506849315068,180 | |
| 6.3891186184353295,0.4384910464286804,0.0004937175715021947,0.5917808219178082,216 | |
| 6.177129533555773,0.46541354060173035,0.0004895694260202649,0.6904109589041096,252 | |
| 6.0227771335177955,0.648460865020752,0.0004844024921488459,0.7890410958904109,288 | |
| 5.8688782585991754,0.7812138199806213,0.0004782387426927524,0.8876712328767123,324 | |
| 5.748586018880208,0.6766534447669983,0.0004711043894958153,0.9863013698630136,360 | |
| 5.643097771538629,0.7119497656822205,0.00046302977197289387,1.084931506849315,396 | |
| 5.579617818196614,0.6135154962539673,0.00045404922808905544,1.1835616438356165,432 | |
| 5.499676174587673,0.6103286743164062,0.0004442009483345982,1.2821917808219179,468 | |
| 5.466448465983073,0.5956920981407166,0.0004335268133168974,1.3808219178082193,504 | |
| 5.4227172003851996,0.7547282576560974,0.0004220722156597303,1.4794520547945205,540 | |
| 5.384627872043186,0.6851129531860352,0.0004098858669674667,1.5780821917808219,576 | |
| 5.315681881374783,0.8210272192955017,0.00039701959067502563,1.6767123287671233,612 | |
| 5.297086927625868,0.8761462569236755,0.00038352810166452056,1.7753424657534247,648 | |
| 5.264489491780599,0.7672809958457947,0.00036946877358579137,1.8739726027397259,684 | |
| 5.236841413709852,0.9996180534362793,0.0003549013948703109,1.9726027397260273,720 | |
| 5.137796613905165,1.3088080883026123,0.0003398879144760376,2.0712328767123287,756 | |
| 5.1366250779893665,0.7240240573883057,0.00032449217844445345,2.16986301369863,792 | |
| 5.117749955919054,0.9408265352249146,0.00030877965839010103,2.2684931506849315,828 | |
| 5.099940829806858,1.027030110359192,0.0002928171730772399,2.367123287671233,864 | |
| 5.078116946750217,1.2956987619400024,0.0002766726042676383,2.4657534246575343,900 | |
| 5.051464504665798,1.4328609704971313,0.00026041460804788384,2.5643835616438357,936 | |
| 5.046279059516059,1.0719691514968872,0.0002441123228638132,2.663013698630137,972 | |
| 5.030543433295356,0.8368586301803589,0.00022783507550367128,2.7616438356164386,1008 | |
| 4.987298329671224,1.0493534803390503,0.0002116520862803286,2.86027397260274,1044 | |
| 5.014145321316189,1.1075105667114258,0.0001956321746662943,2.958904109589041,1080 | |
| 4.959785885281033,0.8196280598640442,0.00017984346663333414,3.0575342465753423,1116 | |
| 4.935692257351345,1.4384323358535767,0.00016435310494125765,3.1561643835616437,1152 | |
| 4.930739084879558,1.4591611623764038,0.00014922696360789367,3.254794520547945,1188 | |
| 4.933997684054905,0.8806025385856628,0.00013452936777449333,3.3534246575342466,1224 | |
| 4.918348524305555,0.8390860557556152,0.00012032282015785648,3.452054794520548,1260 | |
| 4.916364457872179,0.934590756893158,0.00010666773525246593,3.5506849315068494,1296 | |
| 4.896812015109592,1.3669040203094482,9.3622182412956e-05,3.649315068493151,1332 | |
| 4.890383402506511,0.9083628058433533,8.12416389094783e-05,3.747945205479452,1368 | |
| 4.876893361409505,0.6831718683242798,6.957875400611635e-05,3.846575342465753,1404 | |
| 4.886694166395399,0.9987106323242188,5.8683125065625845e-05,3.9452054794520546,1440 | |
| 4.87924321492513,0.7185232639312744,4.860108663263185e-05,4.043835616438356,1476 | |
| 4.832756890190972,0.7183904051780701,3.937551339222484e-05,4.142465753424657,1512 | |
| 4.8694335089789496,0.7409570813179016,3.104563784188938e-05,4.241095890410959,1548 | |
| 4.843637254503038,0.6900330185890198,2.3646883452130618e-05,4.33972602739726,1584 | |
| 4.852745480007595,0.808220386505127,1.7210714025296754e-05,4.438356164383562,1620 | |
| 4.85542975531684,0.7889986634254456,1.1764499893210877e-05,4.536986301369863,1656 | |
| 4.8460366990831165,0.7928687930107117,7.331401522617881e-06,4.635616438356164,1692 | |
| 4.843506707085504,0.7056533098220825,3.9302710234236375e-06,4.734246575342466,1728 | |
| 4.854237874348958,0.870232343673706,1.575571978570639e-06,4.832876712328767,1764 | |
| 4.866808149549696,0.8420959115028381,2.773179364798095e-07,4.931506849315069,1800 | |