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")# 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 files
config.json
CHANGED
|
@@ -12,8 +12,8 @@
|
|
| 12 |
"layer_norm_epsilon": 1e-05,
|
| 13 |
"model_type": "gpt2",
|
| 14 |
"n_ctx": 128,
|
| 15 |
-
"n_embd":
|
| 16 |
-
"n_head":
|
| 17 |
"n_inner": null,
|
| 18 |
"n_layer": 12,
|
| 19 |
"n_positions": 1024,
|
|
|
|
| 12 |
"layer_norm_epsilon": 1e-05,
|
| 13 |
"model_type": "gpt2",
|
| 14 |
"n_ctx": 128,
|
| 15 |
+
"n_embd": 12,
|
| 16 |
+
"n_head": 12,
|
| 17 |
"n_inner": null,
|
| 18 |
"n_layer": 12,
|
| 19 |
"n_positions": 1024,
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8f4be2dbd7ead4dfffac6ec4630edc5210e8ffdb4051efd2e3580cfc73ac4338
|
| 3 |
+
size 5008289
|
runs/Jul18_03-49-07_98d2491cb3e8/events.out.tfevents.1689652161.98d2491cb3e8.251.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:26d189470cfed731da010f474243038cab92ca79b5ac1eb4bf1fda045c9f7806
|
| 3 |
+
size 4222
|
runs/Jul18_04-01-21_98d2491cb3e8/events.out.tfevents.1689652885.98d2491cb3e8.251.1
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1ad3723604ba6feb398f47a953fc0dfa88559a37946929f5ebff5199bcf47e54
|
| 3 |
+
size 4650
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 3899
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dde70e7969867de2c82b44d94a3be4a4a859bcae73969cb76564b4cc6df76a5f
|
| 3 |
size 3899
|