Instructions to use distributed/optimized-gpt2-1b-vtestnet-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use distributed/optimized-gpt2-1b-vtestnet-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="distributed/optimized-gpt2-1b-vtestnet-v2", trust_remote_code=True, device_map="auto")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("distributed/optimized-gpt2-1b-vtestnet-v2", trust_remote_code=True, dtype="auto", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use distributed/optimized-gpt2-1b-vtestnet-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "distributed/optimized-gpt2-1b-vtestnet-v2" # 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-1b-vtestnet-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/distributed/optimized-gpt2-1b-vtestnet-v2
- SGLang
How to use distributed/optimized-gpt2-1b-vtestnet-v2 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-1b-vtestnet-v2" \ --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-1b-vtestnet-v2", "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-1b-vtestnet-v2" \ --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-1b-vtestnet-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use distributed/optimized-gpt2-1b-vtestnet-v2 with Docker Model Runner:
docker model run hf.co/distributed/optimized-gpt2-1b-vtestnet-v2
Epoch 41. Batch Size 608. Peers 2.
Browse files- config.json +2 -2
- model.safetensors +1 -1
- optimizer.pt +1 -1
config.json
CHANGED
|
@@ -3,10 +3,10 @@
|
|
| 3 |
"activation_function": "gelu_new",
|
| 4 |
"all_reduce_scores": {
|
| 5 |
"0": "NON_PARTICIPATING",
|
| 6 |
-
"1": "
|
| 7 |
"2": "SUCCESS",
|
| 8 |
"3": "NON_PARTICIPATING",
|
| 9 |
-
"4": "
|
| 10 |
"5": "NON_PARTICIPATING",
|
| 11 |
"6": "NON_PARTICIPATING",
|
| 12 |
"7": "NON_PARTICIPATING",
|
|
|
|
| 3 |
"activation_function": "gelu_new",
|
| 4 |
"all_reduce_scores": {
|
| 5 |
"0": "NON_PARTICIPATING",
|
| 6 |
+
"1": "NON_PARTICIPATING",
|
| 7 |
"2": "SUCCESS",
|
| 8 |
"3": "NON_PARTICIPATING",
|
| 9 |
+
"4": "NON_PARTICIPATING",
|
| 10 |
"5": "NON_PARTICIPATING",
|
| 11 |
"6": "NON_PARTICIPATING",
|
| 12 |
"7": "NON_PARTICIPATING",
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4040701744
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f79023b39b62f556287d99071921ceab0b9da4d3bf27d7fd7e72a5e15b9708d7
|
| 3 |
size 4040701744
|
optimizer.pt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 8081787874
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:03922fceba9cd94c04100bd8b10fa4712c010565b2ca47c678d2fe1a3d88d542
|
| 3 |
size 8081787874
|