Text Generation
Transformers
Safetensors
slonik
code
postgresql
software-engineering
reinforcement-learning
Instructions to use dglhf/Slonik with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dglhf/Slonik with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dglhf/Slonik")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("dglhf/Slonik", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dglhf/Slonik with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dglhf/Slonik" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dglhf/Slonik", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dglhf/Slonik
- SGLang
How to use dglhf/Slonik 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 "dglhf/Slonik" \ --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": "dglhf/Slonik", "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 "dglhf/Slonik" \ --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": "dglhf/Slonik", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dglhf/Slonik with Docker Model Runner:
docker model run hf.co/dglhf/Slonik
Download 9B/tokenizer_config.json from dglhf/Slonik: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/dglhf/Slonik/resolve/main/9B/tokenizer_config.json
- Command line
-
hf download hf://dglhf/Slonik/9B/tokenizer_config.json
-
curl -L -o tokenizer_config.json https://huggingface.co/dglhf/Slonik/resolve/main/9B/tokenizer_config.json
1.12 kB
| { | |
| "add_prefix_space": false, | |
| "audio_bos_token": "<|audio_start|>", | |
| "audio_eos_token": "<|audio_end|>", | |
| "audio_token": "<|audio_pad|>", | |
| "backend": "tokenizers", | |
| "bos_token": null, | |
| "clean_up_tokenization_spaces": false, | |
| "eos_token": "<|im_end|>", | |
| "errors": "replace", | |
| "image_token": "<|image_pad|>", | |
| "is_local": true, | |
| "local_files_only": true, | |
| "model_max_length": 262144, | |
| "model_specific_special_tokens": { | |
| "audio_bos_token": "<|audio_start|>", | |
| "audio_eos_token": "<|audio_end|>", | |
| "audio_token": "<|audio_pad|>", | |
| "image_token": "<|image_pad|>", | |
| "video_token": "<|video_pad|>", | |
| "vision_bos_token": "<|vision_start|>", | |
| "vision_eos_token": "<|vision_end|>" | |
| }, | |
| "pad_token": "<|endoftext|>", | |
| "pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+", | |
| "split_special_tokens": false, | |
| "tokenizer_class": "Qwen2Tokenizer", | |
| "unk_token": null, | |
| "video_token": "<|video_pad|>", | |
| "vision_bos_token": "<|vision_start|>", | |
| "vision_eos_token": "<|vision_end|>" | |
| } | |