Text Generation
Transformers
TensorBoard
Safetensors
gpt2
Generated from Trainer
text-generation-inference
Instructions to use kaizerBox/gpt2-summarization with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kaizerBox/gpt2-summarization with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kaizerBox/gpt2-summarization")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kaizerBox/gpt2-summarization") model = AutoModelForCausalLM.from_pretrained("kaizerBox/gpt2-summarization") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use kaizerBox/gpt2-summarization with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kaizerBox/gpt2-summarization" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kaizerBox/gpt2-summarization", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/kaizerBox/gpt2-summarization
- SGLang
How to use kaizerBox/gpt2-summarization 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 "kaizerBox/gpt2-summarization" \ --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": "kaizerBox/gpt2-summarization", "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 "kaizerBox/gpt2-summarization" \ --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": "kaizerBox/gpt2-summarization", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use kaizerBox/gpt2-summarization with Docker Model Runner:
docker model run hf.co/kaizerBox/gpt2-summarization
Time is 194.93288735946018 minutes, Memory is 9.5GB
Browse files- README.md +4 -4
- config.json +4 -4
- model.safetensors +2 -2
- runs/Nov28_15-03-43_940adb247ee4/events.out.tfevents.1701183823.940adb247ee4.323.0 +3 -0
- training_args.bin +1 -1
README.md
CHANGED
|
@@ -15,7 +15,7 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 15 |
|
| 16 |
This model is a fine-tuned version of [](https://huggingface.co/) on the xsum dataset.
|
| 17 |
It achieves the following results on the evaluation set:
|
| 18 |
-
- Loss: 4.
|
| 19 |
|
| 20 |
## Model description
|
| 21 |
|
|
@@ -50,9 +50,9 @@ The following hyperparameters were used during training:
|
|
| 50 |
|
| 51 |
| Training Loss | Epoch | Step | Validation Loss |
|
| 52 |
|:-------------:|:-----:|:-----:|:---------------:|
|
| 53 |
-
| 4.
|
| 54 |
-
| 4.
|
| 55 |
-
| 4.
|
| 56 |
|
| 57 |
|
| 58 |
### Framework versions
|
|
|
|
| 15 |
|
| 16 |
This model is a fine-tuned version of [](https://huggingface.co/) on the xsum dataset.
|
| 17 |
It achieves the following results on the evaluation set:
|
| 18 |
+
- Loss: 4.0256
|
| 19 |
|
| 20 |
## Model description
|
| 21 |
|
|
|
|
| 50 |
|
| 51 |
| Training Loss | Epoch | Step | Validation Loss |
|
| 52 |
|:-------------:|:-----:|:-----:|:---------------:|
|
| 53 |
+
| 4.7214 | 1.0 | 5762 | 4.2254 |
|
| 54 |
+
| 4.1228 | 2.0 | 11525 | 4.0669 |
|
| 55 |
+
| 4.0011 | 3.0 | 17286 | 4.0256 |
|
| 56 |
|
| 57 |
|
| 58 |
### Framework versions
|
config.json
CHANGED
|
@@ -3,20 +3,20 @@
|
|
| 3 |
"architectures": [
|
| 4 |
"GPT2LMHeadModel"
|
| 5 |
],
|
| 6 |
-
"attn_pdrop": 0.
|
| 7 |
"bos_token_id": 50256,
|
| 8 |
-
"embd_pdrop": 0.
|
| 9 |
"eos_token_id": 50256,
|
| 10 |
"initializer_range": 0.02,
|
| 11 |
"layer_norm_epsilon": 1e-05,
|
| 12 |
"model_type": "gpt2",
|
| 13 |
"n_embd": 128,
|
| 14 |
"n_head": 2,
|
| 15 |
-
"n_inner":
|
| 16 |
"n_layer": 3,
|
| 17 |
"n_positions": 1024,
|
| 18 |
"reorder_and_upcast_attn": false,
|
| 19 |
-
"resid_pdrop": 0.
|
| 20 |
"scale_attn_by_inverse_layer_idx": false,
|
| 21 |
"scale_attn_weights": true,
|
| 22 |
"summary_activation": null,
|
|
|
|
| 3 |
"architectures": [
|
| 4 |
"GPT2LMHeadModel"
|
| 5 |
],
|
| 6 |
+
"attn_pdrop": 0.0,
|
| 7 |
"bos_token_id": 50256,
|
| 8 |
+
"embd_pdrop": 0.0,
|
| 9 |
"eos_token_id": 50256,
|
| 10 |
"initializer_range": 0.02,
|
| 11 |
"layer_norm_epsilon": 1e-05,
|
| 12 |
"model_type": "gpt2",
|
| 13 |
"n_embd": 128,
|
| 14 |
"n_head": 2,
|
| 15 |
+
"n_inner": 128,
|
| 16 |
"n_layer": 3,
|
| 17 |
"n_positions": 1024,
|
| 18 |
"reorder_and_upcast_attn": false,
|
| 19 |
+
"resid_pdrop": 0.0,
|
| 20 |
"scale_attn_by_inverse_layer_idx": false,
|
| 21 |
"scale_attn_weights": true,
|
| 22 |
"summary_activation": null,
|
model.safetensors
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:e54bcc781ea24987eb720ec863042cd076ba2bcb8b84faaea8a5d35d40deabf2
|
| 3 |
+
size 27456776
|
runs/Nov28_15-03-43_940adb247ee4/events.out.tfevents.1701183823.940adb247ee4.323.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9fa8b58e2c3d5408de47f0c098f4f7055fc7e07ce33ec1db74babf41dd30ffbd
|
| 3 |
+
size 5922
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4600
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b9596d478b85074461b1bd9e3792f4de79e2758b9a5be432bc062f673ddf0c22
|
| 3 |
size 4600
|