Text Generation
Transformers
Safetensors
qwen2
multilingual
sea
sailor
conversational
text-generation-inference
Instructions to use sail/Sailor2-14B-Chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sail/Sailor2-14B-Chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sail/Sailor2-14B-Chat") 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-Chat") model = AutoModelForCausalLM.from_pretrained("sail/Sailor2-14B-Chat", 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-Chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sail/Sailor2-14B-Chat" # 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-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sail/Sailor2-14B-Chat
- SGLang
How to use sail/Sailor2-14B-Chat 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-Chat" \ --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-Chat", "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-Chat" \ --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-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sail/Sailor2-14B-Chat with Docker Model Runner:
docker model run hf.co/sail/Sailor2-14B-Chat
Commit History
-
Upload folder using huggingface_hub (#1)
Verified signature- 1ba7259275f06d9ea7e05878fd1176d4b11ea3399d0260532af2023e50a7ebfa (822dae1e84bd6009b14af3927ee6988150f05dd4) - 8df136acdee62f8cc2d6a30dfde80e6610a232cf59703fb33c49f2e7366d9fe0 (adfc5bd180063ac992e5a7f3d4edc8c1a9424eec) - ce672b89d52fa188caaa359fa1fda616397635fe8f7f6c18194efb49b30ff6cc (f3537c494d2a2e2215d34e9f441161acc18261ad) - a9462af94a9cb6b391fcd494013b882544e1da9287b4fffdc5c6fbaff6093e2b (3af244d1ce4a8dbbc455687e5e1dce9a8c6f78a6) - caae1eebabbaf585b466020da2529d673735cb61e970e1e8c7927b5b95a7d024 (13a0b4d41816eb105ab6d229b2fe7947d3db0061) - 97ef996a1235519b927f326bf93aa6b943ba52c1ea5b035dcd5a579f959de28e (5286771b2ef415816c17b495033576035926fbe5) - 89c5913e581f8f6ed65ea3380916765457f9a1cd4d00b00cfc6a79f3015c25c9 (ec43798e5a324e2add5c224b82c37d32e52c6bb4)7ce62c3