Text Generation
Transformers
Safetensors
English
gpt2
text-generation-inference
8-bit precision
bitsandbytes
Instructions to use rony/gpt2-quantized-jokes with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rony/gpt2-quantized-jokes with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rony/gpt2-quantized-jokes")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rony/gpt2-quantized-jokes") model = AutoModelForCausalLM.from_pretrained("rony/gpt2-quantized-jokes") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rony/gpt2-quantized-jokes with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rony/gpt2-quantized-jokes" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rony/gpt2-quantized-jokes", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/rony/gpt2-quantized-jokes
- SGLang
How to use rony/gpt2-quantized-jokes 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 "rony/gpt2-quantized-jokes" \ --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": "rony/gpt2-quantized-jokes", "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 "rony/gpt2-quantized-jokes" \ --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": "rony/gpt2-quantized-jokes", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use rony/gpt2-quantized-jokes with Docker Model Runner:
docker model run hf.co/rony/gpt2-quantized-jokes
Upload tokenizer
Browse files- special_tokens_map.json +3 -21
- tokenizer.json +0 -0
- tokenizer_config.json +0 -3
- vocab.json +0 -0
special_tokens_map.json
CHANGED
|
@@ -1,23 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"bos_token":
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
"normalized": true,
|
| 6 |
-
"rstrip": false,
|
| 7 |
-
"single_word": false
|
| 8 |
-
},
|
| 9 |
-
"eos_token": {
|
| 10 |
-
"content": "<|endoftext|>",
|
| 11 |
-
"lstrip": false,
|
| 12 |
-
"normalized": true,
|
| 13 |
-
"rstrip": false,
|
| 14 |
-
"single_word": false
|
| 15 |
-
},
|
| 16 |
-
"unk_token": {
|
| 17 |
-
"content": "<|endoftext|>",
|
| 18 |
-
"lstrip": false,
|
| 19 |
-
"normalized": true,
|
| 20 |
-
"rstrip": false,
|
| 21 |
-
"single_word": false
|
| 22 |
-
}
|
| 23 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"bos_token": "<|endoftext|>",
|
| 3 |
+
"eos_token": "<|endoftext|>",
|
| 4 |
+
"unk_token": "<|endoftext|>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"add_bos_token": false,
|
| 3 |
"add_prefix_space": false,
|
| 4 |
"added_tokens_decoder": {
|
| 5 |
"50256": {
|
|
@@ -14,9 +13,7 @@
|
|
| 14 |
"bos_token": "<|endoftext|>",
|
| 15 |
"clean_up_tokenization_spaces": true,
|
| 16 |
"eos_token": "<|endoftext|>",
|
| 17 |
-
"errors": "replace",
|
| 18 |
"model_max_length": 1024,
|
| 19 |
-
"pad_token": null,
|
| 20 |
"tokenizer_class": "GPT2Tokenizer",
|
| 21 |
"unk_token": "<|endoftext|>"
|
| 22 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"add_prefix_space": false,
|
| 3 |
"added_tokens_decoder": {
|
| 4 |
"50256": {
|
|
|
|
| 13 |
"bos_token": "<|endoftext|>",
|
| 14 |
"clean_up_tokenization_spaces": true,
|
| 15 |
"eos_token": "<|endoftext|>",
|
|
|
|
| 16 |
"model_max_length": 1024,
|
|
|
|
| 17 |
"tokenizer_class": "GPT2Tokenizer",
|
| 18 |
"unk_token": "<|endoftext|>"
|
| 19 |
}
|
vocab.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|