Instructions to use auhide/gpt2-small-bgwiki with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use auhide/gpt2-small-bgwiki with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="auhide/gpt2-small-bgwiki")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("auhide/gpt2-small-bgwiki") model = AutoModelForCausalLM.from_pretrained("auhide/gpt2-small-bgwiki", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use auhide/gpt2-small-bgwiki with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "auhide/gpt2-small-bgwiki" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "auhide/gpt2-small-bgwiki", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/auhide/gpt2-small-bgwiki
- SGLang
How to use auhide/gpt2-small-bgwiki 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 "auhide/gpt2-small-bgwiki" \ --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": "auhide/gpt2-small-bgwiki", "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 "auhide/gpt2-small-bgwiki" \ --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": "auhide/gpt2-small-bgwiki", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use auhide/gpt2-small-bgwiki with Docker Model Runner:
docker model run hf.co/auhide/gpt2-small-bgwiki
Upload tokenizer
Browse files- added_tokens.json +1 -0
- special_tokens_map.json +1 -1
- tokenizer.json +9 -0
added_tokens.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"[CLS]": 50257,
|
| 3 |
"[EOL]": 50260,
|
|
|
|
| 4 |
"[PAD]": 50259,
|
| 5 |
"[SEP]": 50258
|
| 6 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"[CLS]": 50257,
|
| 3 |
"[EOL]": 50260,
|
| 4 |
+
"[EOS]": 50261,
|
| 5 |
"[PAD]": 50259,
|
| 6 |
"[SEP]": 50258
|
| 7 |
}
|
special_tokens_map.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"additional_special_tokens": [
|
| 3 |
-
"[
|
| 4 |
],
|
| 5 |
"bos_token": "[CLS]",
|
| 6 |
"eos_token": "[SEP]",
|
|
|
|
| 1 |
{
|
| 2 |
"additional_special_tokens": [
|
| 3 |
+
"[EOS]"
|
| 4 |
],
|
| 5 |
"bos_token": "[CLS]",
|
| 6 |
"eos_token": "[SEP]",
|
tokenizer.json
CHANGED
|
@@ -52,6 +52,15 @@
|
|
| 52 |
"rstrip": false,
|
| 53 |
"normalized": false,
|
| 54 |
"special": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
}
|
| 56 |
],
|
| 57 |
"normalizer": null,
|
|
|
|
| 52 |
"rstrip": false,
|
| 53 |
"normalized": false,
|
| 54 |
"special": true
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"id": 50261,
|
| 58 |
+
"content": "[EOS]",
|
| 59 |
+
"single_word": false,
|
| 60 |
+
"lstrip": false,
|
| 61 |
+
"rstrip": false,
|
| 62 |
+
"normalized": false,
|
| 63 |
+
"special": true
|
| 64 |
}
|
| 65 |
],
|
| 66 |
"normalizer": null,
|