Text Generation
Transformers
Safetensors
qwen2
multilingual
sea
sailor
sft
chat
instruction
conversational
text-generation-inference
Instructions to use sail/Sailor2-L-8B-Chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sail/Sailor2-L-8B-Chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sail/Sailor2-L-8B-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-L-8B-Chat") model = AutoModelForCausalLM.from_pretrained("sail/Sailor2-L-8B-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-L-8B-Chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sail/Sailor2-L-8B-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-L-8B-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sail/Sailor2-L-8B-Chat
- SGLang
How to use sail/Sailor2-L-8B-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-L-8B-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-L-8B-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-L-8B-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-L-8B-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sail/Sailor2-L-8B-Chat with Docker Model Runner:
docker model run hf.co/sail/Sailor2-L-8B-Chat
Commit History
-
Upload folder using huggingface_hub (#1)
Verified signature- 98a84511f27595bc8213a49ee4a07a52625164aef5eb7d70b9c78c2ac73fed4a (73172e57a716644a601af5d0e3327c6116577d83) - 40dde603e4a186258bdc0ae4f52be71ecd2bd46853ca475958467655cae8827a (9a877db5a135067c01f9260e8244e388ddd6e536) - 5705fe95aade0d265145fe9e5a8975ac8290ecb0ea998dfeb5daa2bf75b380e4 (ac95b9655424b9fbf80d2ce4210cb53b9020751a) - 7bbe6406ae4ac0abd90e1645882b3cf692e07a9730da4991b6516d35b806d573 (c3fd54eed0cf678f3e57943ea4c498a985c812df) - 44dc2daf25d94e2d0cb96f7040e74d08fc3c7d9d1585fc86f7cc42cbd729663f (76dc0ef08bba8561b24bf9677179f1752df0ef2c)113734b