Instructions to use heegyu/ajoublue-gpt2-base-24L with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use heegyu/ajoublue-gpt2-base-24L with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="heegyu/ajoublue-gpt2-base-24L")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("heegyu/ajoublue-gpt2-base-24L") model = AutoModelForCausalLM.from_pretrained("heegyu/ajoublue-gpt2-base-24L") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use heegyu/ajoublue-gpt2-base-24L with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "heegyu/ajoublue-gpt2-base-24L" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "heegyu/ajoublue-gpt2-base-24L", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/heegyu/ajoublue-gpt2-base-24L
- SGLang
How to use heegyu/ajoublue-gpt2-base-24L 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 "heegyu/ajoublue-gpt2-base-24L" \ --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": "heegyu/ajoublue-gpt2-base-24L", "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 "heegyu/ajoublue-gpt2-base-24L" \ --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": "heegyu/ajoublue-gpt2-base-24L", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use heegyu/ajoublue-gpt2-base-24L with Docker Model Runner:
docker model run hf.co/heegyu/ajoublue-gpt2-base-24L
add pytorch model
Browse files- config.json +2 -1
- generation_config.json +6 -0
- pytorch_model.bin +3 -0
config.json
CHANGED
|
@@ -32,7 +32,8 @@
|
|
| 32 |
"max_length": 50
|
| 33 |
}
|
| 34 |
},
|
| 35 |
-
"
|
|
|
|
| 36 |
"use_cache": true,
|
| 37 |
"vocab_size": 51200
|
| 38 |
}
|
|
|
|
| 32 |
"max_length": 50
|
| 33 |
}
|
| 34 |
},
|
| 35 |
+
"torch_dtype": "float32",
|
| 36 |
+
"transformers_version": "4.26.0",
|
| 37 |
"use_cache": true,
|
| 38 |
"vocab_size": 51200
|
| 39 |
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 2,
|
| 5 |
+
"transformers_version": "4.26.0"
|
| 6 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5347a7734a42e6077b97190aa5d14bf3ad56f2bd79b695f398330725c4531b53
|
| 3 |
+
size 866145949
|