Text Generation
Transformers
PyTorch
TensorBoard
gpt2
Generated from Trainer
text-generation-inference
Instructions to use Langame/distilgpt2-starter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Langame/distilgpt2-starter with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Langame/distilgpt2-starter")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Langame/distilgpt2-starter") model = AutoModelForCausalLM.from_pretrained("Langame/distilgpt2-starter") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Langame/distilgpt2-starter with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Langame/distilgpt2-starter" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Langame/distilgpt2-starter", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Langame/distilgpt2-starter
- SGLang
How to use Langame/distilgpt2-starter 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 "Langame/distilgpt2-starter" \ --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": "Langame/distilgpt2-starter", "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 "Langame/distilgpt2-starter" \ --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": "Langame/distilgpt2-starter", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Langame/distilgpt2-starter with Docker Model Runner:
docker model run hf.co/Langame/distilgpt2-starter
Commit ·
9f1d5cf
1
Parent(s): d8753f5
Training in progress, step 500
Browse files
config.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
"attn_pdrop": 0.1,
|
| 9 |
"bos_token_id": 50256,
|
| 10 |
"embd_pdrop": 0.1,
|
| 11 |
-
"eos_token_id":
|
| 12 |
"id2label": {
|
| 13 |
"0": "LABEL_0"
|
| 14 |
},
|
|
@@ -40,7 +40,7 @@
|
|
| 40 |
}
|
| 41 |
},
|
| 42 |
"torch_dtype": "float16",
|
| 43 |
-
"transformers_version": "4.
|
| 44 |
"use_cache": true,
|
| 45 |
"vocab_size": 50257
|
| 46 |
}
|
|
|
|
| 8 |
"attn_pdrop": 0.1,
|
| 9 |
"bos_token_id": 50256,
|
| 10 |
"embd_pdrop": 0.1,
|
| 11 |
+
"eos_token_id": 50256,
|
| 12 |
"id2label": {
|
| 13 |
"0": "LABEL_0"
|
| 14 |
},
|
|
|
|
| 40 |
}
|
| 41 |
},
|
| 42 |
"torch_dtype": "float16",
|
| 43 |
+
"transformers_version": "4.17.0.dev0",
|
| 44 |
"use_cache": true,
|
| 45 |
"vocab_size": 50257
|
| 46 |
}
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 170133438
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:32b2a175cf052e0325d31f9bf38be6fd08b01c438034356c2c119416285f699b
|
| 3 |
size 170133438
|
runs/Jan28_16-59-28_1f25944bc523/1643389724.2294521/events.out.tfevents.1643389724.1f25944bc523.834.1
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c219514c938df9812617d52bf2cd256f39a18e52c876deccc0ef98fa03fe4702
|
| 3 |
+
size 4787
|
runs/Jan28_16-59-28_1f25944bc523/events.out.tfevents.1643389724.1f25944bc523.834.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:226f360430923bbb6a894998cc5e432f1280874402c73d22dd005f85e294cecf
|
| 3 |
+
size 4372
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4143
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f4a76902537680481f816f6f2fd42795704a319622e65400861458e368ecb27b
|
| 3 |
size 4143
|