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
- 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 2. Batch Size 76. Peers 0.
Browse files- model-00001-of-00002.safetensors +1 -1
- model-00002-of-00002.safetensors +1 -1
- optimizer.pt +1 -1
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:65658133829779c5efee50ca2ada62eea4a50c9a50f95006fb9630d63ca9f073
|
| 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:e15e3dc194d5537d54695e622c7ed26fab6d62a70f3dbca419a4bd5c547f7314
|
| 3 |
size 3075942944
|
optimizer.pt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4675070692
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:16a19bc99ccf009a0f3a76a3c1e99c64ab764a65d9c2fc57691160bddbc9f7dd
|
| 3 |
size 4675070692
|