Text Generation
Transformers
Safetensors
qwen2
multilingual
sea
sailor
conversational
text-generation-inference
Instructions to use sail/Sailor2-14B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sail/Sailor2-14B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sail/Sailor2-14B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sail/Sailor2-14B") model = AutoModelForCausalLM.from_pretrained("sail/Sailor2-14B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sail/Sailor2-14B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sail/Sailor2-14B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sail/Sailor2-14B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sail/Sailor2-14B
- SGLang
How to use sail/Sailor2-14B 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 "sail/Sailor2-14B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sail/Sailor2-14B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "sail/Sailor2-14B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sail/Sailor2-14B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sail/Sailor2-14B with Docker Model Runner:
docker model run hf.co/sail/Sailor2-14B
Commit History
-
Update README.md
Verified signature16f995f
-
Upload sailor2_banner.jpg
Verified signaturebe79e48 -
Create README.md
Verified signaturebd8c2d6
-
Upload folder using huggingface_hub (#1)
Verified signature- 6cd59329aab449cf0dbf16325770d01a8d262bbfecf5ed7c30e3e576e199a146 (4b8cc3ae8e31377f458067798d829cf4b89df9f1) - fc14dfba254770f970575fab0135cf4a5cbaeb9a8e5b0da716cb3f10a11988ec (8947573809f2b265018c2aa767d5f20dfabc34e9) - c400b908d167792cf177d090f9daa3223eb38077f0a8e5529fe44391a2137884 (7511d6425a4808b2f3ea98a30e460237341ed136) - 834ea6a06ff3aa764df00c168a90be230638eaebc4fbf581ea8473200ddda3bf (bd7d5986d1192b0fc8bd558cb4b31329a0b21f8b) - 2f5ff1a38f0a1c020ce289ea655bccb8ebe36559a3ef7efc19b05f3dfd2ad193 (21c14837c44f2a7cdafa260670d3635212de985e) - 6f5191877b7300b2550a4aefe88ff7db16a9a17dea9a9b4307aa017dcd92a088 (74fa4a64f107e32daf6fa526cb66ae54ad8ce463) - 0895cbedaa96198b140ec903c58f6ef60a02a66d182961c24a04e5727e891204 (ca7f1cd5a087cb7db59db6a24e8953b5c1ff7c5d) - a919e3573aa8a13913e120b155c0b9240e88621b876a0dfec583074543dd99f5 (6305e81d68c9dda748e7ae991226db49cd452b29)5096379 -
initial commit
Verified signature50e8985