Text Generation
Transformers
PyTorch
TensorBoard
gpt2
Generated from Trainer
text-generation-inference
Instructions to use dimzhead/gpt2-test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dimzhead/gpt2-test with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dimzhead/gpt2-test")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelWithLMHead tokenizer = AutoTokenizer.from_pretrained("dimzhead/gpt2-test") model = AutoModelWithLMHead.from_pretrained("dimzhead/gpt2-test", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dimzhead/gpt2-test with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dimzhead/gpt2-test" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dimzhead/gpt2-test", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dimzhead/gpt2-test
- SGLang
How to use dimzhead/gpt2-test 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 "dimzhead/gpt2-test" \ --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": "dimzhead/gpt2-test", "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 "dimzhead/gpt2-test" \ --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": "dimzhead/gpt2-test", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dimzhead/gpt2-test with Docker Model Runner:
docker model run hf.co/dimzhead/gpt2-test
Training in progress, step 5000
Browse filesFiles changed (5)
11 unmodified lines121314151617181911 unmodified lines"layer_norm_epsilon": 1e-05,"model_type": "gpt2","n_ctx": 128,"n_embd": 4,"n_head": 4,"n_inner": null,"n_layer": 12,"n_positions": 1024,11 unmodified lines121314151617181911 unmodified lines"layer_norm_epsilon": 1e-05,"model_type": "gpt2","n_ctx": 128,"n_embd": 12,"n_head": 12,"n_inner": null,"n_layer": 12,"n_positions": 1024,
123version https://git-lfs.github.com/spec/v1oid sha256:24e928409d069feaa88d5931aa5ec511feeebf372c3dc908f601714fd59dacb5size 1682273123version https://git-lfs.github.com/spec/v1oid sha256:8f4be2dbd7ead4dfffac6ec4630edc5210e8ffdb4051efd2e3580cfc73ac4338size 5008289
123version https://git-lfs.github.com/spec/v1oid sha256:26d189470cfed731da010f474243038cab92ca79b5ac1eb4bf1fda045c9f7806size 4222123version https://git-lfs.github.com/spec/v1oid sha256:1ad3723604ba6feb398f47a953fc0dfa88559a37946929f5ebff5199bcf47e54size 4650123version https://git-lfs.github.com/spec/v1oid sha256:5985edbaad3d2bc40cd53f8520fdf846d7f2c9868e6327880a43146b5cefe7acsize 3899123version https://git-lfs.github.com/spec/v1oid sha256:dde70e7969867de2c82b44d94a3be4a4a859bcae73969cb76564b4cc6df76a5fsize 3899
config.json+2-2
pytorch_model.bin+2-2
runs/Jul18_03-49-07_98d2491cb3e8/events.out.tfevents.1689652161.98d2491cb3e8.251.0Added+3
runs/Jul18_04-01-21_98d2491cb3e8/events.out.tfevents.1689652885.98d2491cb3e8.251.1Added+3
training_args.bin+1-1