Instructions to use distributed/optimized-gpt2-2b-without-stable-embeddings with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use distributed/optimized-gpt2-2b-without-stable-embeddings with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="distributed/optimized-gpt2-2b-without-stable-embeddings", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("distributed/optimized-gpt2-2b-without-stable-embeddings", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use distributed/optimized-gpt2-2b-without-stable-embeddings with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "distributed/optimized-gpt2-2b-without-stable-embeddings" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "distributed/optimized-gpt2-2b-without-stable-embeddings", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/distributed/optimized-gpt2-2b-without-stable-embeddings
- SGLang
How to use distributed/optimized-gpt2-2b-without-stable-embeddings 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 "distributed/optimized-gpt2-2b-without-stable-embeddings" \ --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": "distributed/optimized-gpt2-2b-without-stable-embeddings", "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 "distributed/optimized-gpt2-2b-without-stable-embeddings" \ --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": "distributed/optimized-gpt2-2b-without-stable-embeddings", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use distributed/optimized-gpt2-2b-without-stable-embeddings with Docker Model Runner:
docker model run hf.co/distributed/optimized-gpt2-2b-without-stable-embeddings
Epoch 0. Batch Size 80. Peers 0.
Browse files- config.json +3 -3
- model-00001-of-00002.safetensors +1 -1
- model-00002-of-00002.safetensors +1 -1
- optimizer.pt +3 -0
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "/
|
| 3 |
"activation_function": "gelu_new",
|
| 4 |
"all_reduce_scores": {
|
| 5 |
"0": "NON_PARTICIPATING",
|
|
@@ -264,8 +264,8 @@
|
|
| 264 |
],
|
| 265 |
"attn_pdrop": 0.1,
|
| 266 |
"auto_map": {
|
| 267 |
-
"AutoConfig": "configuration_gpt_optimized.GPTOptimConfig",
|
| 268 |
-
"AutoModelForCausalLM": "modeling_gpt_optimized.GPTOptim"
|
| 269 |
},
|
| 270 |
"block_size": 1024,
|
| 271 |
"bos_token_id": 50256,
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "distributed/optimized-gpt2-2b-without-stable-embeddings",
|
| 3 |
"activation_function": "gelu_new",
|
| 4 |
"all_reduce_scores": {
|
| 5 |
"0": "NON_PARTICIPATING",
|
|
|
|
| 264 |
],
|
| 265 |
"attn_pdrop": 0.1,
|
| 266 |
"auto_map": {
|
| 267 |
+
"AutoConfig": "distributed/optimized-gpt2-2b-without-stable-embeddings--configuration_gpt_optimized.GPTOptimConfig",
|
| 268 |
+
"AutoModelForCausalLM": "distributed/optimized-gpt2-2b-without-stable-embeddings--modeling_gpt_optimized.GPTOptim"
|
| 269 |
},
|
| 270 |
"block_size": 1024,
|
| 271 |
"bos_token_id": 50256,
|
model-00001-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4975530824
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3672b53c226d30983302cfa80c8150c581d305ff1d1203f969b1f0615ef3983e
|
| 3 |
size 4975530824
|
model-00002-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 3075942944
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:94c2ed63a740dc1dcd96e0de216e9360f21222b24bd802898b8e57547077dd65
|
| 3 |
size 3075942944
|
optimizer.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e232a713945ce12e55e463ee502d54fd8769edcbee991c9fb46b22f3a772f1fe
|
| 3 |
+
size 4675070692
|