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 train_log.csv from MeshMax/gpt2-reuters-from-scratch: direct link, hf CLI and curl.
- Browser
- Download file 4.22 kB
-
https://huggingface.co/MeshMax/gpt2-reuters-from-scratch/resolve/main/train_log.csv
- Command line
-
hf download hf://MeshMax/gpt2-reuters-from-scratch/train_log.csv
-
curl -L -o train_log.csv https://huggingface.co/MeshMax/gpt2-reuters-from-scratch/resolve/main/train_log.csv
4.22 kB
| loss,grad_norm,learning_rate,epoch,step | |
| 10.836315155029297,4.207400321960449,0.0,0.0026954177897574125,1 | |
| 10.077797783745659,1.7047362327575684,0.0001956521739130435,0.09973045822102426,37 | |
| 8.025718070365286,1.1678972244262695,0.0003967391304347826,0.19946091644204852,74 | |
| 6.545615943702492,0.5898693203926086,0.0004998714083084109,0.2991913746630728,111 | |
| 6.062786617794552,0.4992395341396332,0.0004988002718478092,0.39892183288409705,148 | |
| 5.785431733002534,0.6450517177581787,0.0004966479701151181,0.49865229110512127,185 | |
| 5.61850676665435,0.5887101292610168,0.0004934238559694447,0.5983827493261455,222 | |
| 5.485730557828336,0.6118780970573425,0.0004891419398466367,0.6981132075471698,259 | |
| 5.345864373284417,0.713479220867157,0.00048382082887672473,0.7978436657681941,296 | |
| 5.249631314664273,0.7902956008911133,0.0004774836460263635,0.8975741239892183,333 | |
| 5.165928196262669,0.7351539134979248,0.0004701579296176369,0.9973045822102425,370 | |
| 5.018535717113598,0.7183128595352173,0.0004618755136598708,1.0970350404312668,407 | |
| 4.945215586069468,0.731693685054779,0.00045267238951447335,1.196765498652291,444 | |
| 4.891061731286951,0.7142863273620605,0.0004425885494939402,1.2964959568733154,481 | |
| 4.824448044235642,0.9445986747741699,0.00043166781307466727,1.3962264150943398,518 | |
| 4.791888675174198,0.6783811450004578,0.00041995763647876573,1.4959568733153639,555 | |
| 4.736610618797508,0.7872018814086914,0.0004075089064523452,1.595687331536388,592 | |
| 4.697997222075591,0.8122515082359314,0.00039437571913640356,1.6954177897574123,629 | |
| 4.653890661291174,0.7161594033241272,0.00038061514499124384,1.7951482479784366,666 | |
| 4.634747891812711,0.857439398765564,0.0003662869807959419,1.894878706199461,703 | |
| 4.579890070734797,0.7428545355796814,0.0003514534898005568,1.9946091644204853,740 | |
| 4.4692106504698055,0.9065433740615845,0.00033617913116025294,2.0943396226415096,777 | |
| 4.481308395798142,0.820570170879364,0.0003205302798270863,2.1940700808625335,814 | |
| 4.41814154547614,0.829656183719635,0.0003045749381166646,2.293800539083558,851 | |
| 4.38438250567462,0.8162329196929932,0.00028838244020307647,2.393530997304582,888 | |
| 4.369291150892103,0.7697203159332275,0.0002720231508262099,2.4932614555256065,925 | |
| 4.363017726588893,0.7923586964607239,0.00025556815952073014,2.592991913746631,962 | |
| 4.315720016891892,0.7529708743095398,0.00023908897169545341,2.6927223719676547,999 | |
| 4.325791230072847,0.7411993741989136,0.00022265719790553147,2.7924528301886795,1036 | |
| 4.326729027000633,0.9065942168235779,0.00020634424266772192,2.8921832884097034,1073 | |
| 4.266080701673353,0.8686316609382629,0.00019022099417100196,2.9919137466307277,1110 | |
| 4.18863244958826,0.8677141666412354,0.00017435751623089084,3.091644204851752,1147 | |
| 4.1504281533731,0.9264596700668335,0.00015882274382610068,3.1913746630727764,1184 | |
| 4.168645910314612,0.7659245729446411,0.00014368418354056395,3.2911051212938007,1221 | |
| 4.1577993856894,0.78602135181427,0.00012900762021257113,3.3908355795148246,1258 | |
| 4.164654293575802,0.8093656301498413,0.00011485683106578032,3.490566037735849,1295 | |
| 4.088740580790752,0.8626163005828857,0.00010129330856434574,3.5902964959568733,1332 | |
| 4.134875735721073,0.8359922170639038,8.837599319650267e-05,3.6900269541778976,1369 | |
| 4.101410736908784,0.7985906600952148,7.616101734780126e-05,3.789757412398922,1406 | |
| 4.116690558356208,0.7598577737808228,6.470146137699245e-05,3.889487870619946,1443 | |
| 4.119724170581715,0.8201590776443481,5.404712295454173e-05,3.9892183288409706,1480 | |
| 4.043276400179477,0.7463505864143372,4.424430066611343e-05,4.0889487870619945,1517 | |
| 4.027329316010347,0.7498629689216614,3.5335592821379795e-05,4.188679245283019,1554 | |
| 4.036310144372888,0.7858643531799316,2.7359712342434368e-05,4.288409703504043,1591 | |
| 4.048788122228674,0.7761735916137695,2.0351318536215026e-05,4.388140161725067,1628 | |
| 4.029813199429898,0.8068888187408447,1.434086648197111e-05,4.487870619946092,1665 | |
| 4.045261692356419,0.8213040828704834,9.354474688265224e-06,4.587601078167116,1702 | |
| 4.019159265466638,0.7702659964561462,5.413811594606438e-06,4.6873315363881405,1739 | |
| 4.052992949614653,0.7770928740501404,2.536001410925165e-06,4.787061994609164,1776 | |
| 4.046570236618455,0.7518254518508911,7.335497040648898e-07,4.886792452830189,1813 | |
| 4.009363122888513,0.7611401677131653,1.4289054655836075e-08,4.986522911051213,1850 | |