Text Generation
Transformers
Safetensors
qwen2
sea
multilingual
conversational
text-generation-inference
Instructions to use SeaLLMs/SeaLLMs-v3-7B-Chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SeaLLMs/SeaLLMs-v3-7B-Chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SeaLLMs/SeaLLMs-v3-7B-Chat") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SeaLLMs/SeaLLMs-v3-7B-Chat") model = AutoModelForCausalLM.from_pretrained("SeaLLMs/SeaLLMs-v3-7B-Chat") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use SeaLLMs/SeaLLMs-v3-7B-Chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SeaLLMs/SeaLLMs-v3-7B-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": "SeaLLMs/SeaLLMs-v3-7B-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SeaLLMs/SeaLLMs-v3-7B-Chat
- SGLang
How to use SeaLLMs/SeaLLMs-v3-7B-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 "SeaLLMs/SeaLLMs-v3-7B-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": "SeaLLMs/SeaLLMs-v3-7B-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 "SeaLLMs/SeaLLMs-v3-7B-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": "SeaLLMs/SeaLLMs-v3-7B-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SeaLLMs/SeaLLMs-v3-7B-Chat with Docker Model Runner:
docker model run hf.co/SeaLLMs/SeaLLMs-v3-7B-Chat
Update README.md
Browse files
README.md
CHANGED
|
@@ -20,7 +20,7 @@ tags:
|
|
| 20 |
<p align="center">
|
| 21 |
<a href="https://damo-nlp-sg.github.io/SeaLLMs/" target="_blank" rel="noopener">Website</a>
|
| 22 |
|
| 23 |
-
<a href="https://huggingface.co/SeaLLMs/
|
| 24 |
|
| 25 |
<a href="https://huggingface.co/spaces/SeaLLMs/SeaLLM-Chat" target="_blank" rel="noopener"> 🤗 DEMO</a>
|
| 26 |
|
|
@@ -40,7 +40,9 @@ We introduce **SeaLLMs-v3**, the latest series of the SeaLLMs (Large Language Mo
|
|
| 40 |
|
| 41 |
SeaLLMs is tailored for handling a wide range of languages spoken in the SEA region, including English, Chinese, Indonesian, Vietnamese, Thai, Tagalog, Malay, Burmese, Khmer, Lao, Tamil, and Javanese.
|
| 42 |
|
| 43 |
-
This page introduces the SeaLLMs-v3-7B-Chat model, specifically fine-tuned to follow human instructions effectively for task completion, making it directly applicable to your applications.
|
|
|
|
|
|
|
| 44 |
|
| 45 |
|
| 46 |
### Get started with `Transformers`
|
|
@@ -53,11 +55,11 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 53 |
device = "cuda" # the device to load the model onto
|
| 54 |
|
| 55 |
model = AutoModelForCausalLM.from_pretrained(
|
| 56 |
-
"SeaLLMs/
|
| 57 |
torch_dtype=torch.bfloat16,
|
| 58 |
device_map=device
|
| 59 |
)
|
| 60 |
-
tokenizer = AutoTokenizer.from_pretrained("SeaLLMs/
|
| 61 |
|
| 62 |
# prepare messages to model
|
| 63 |
prompt = "Hiii How are you?"
|
|
@@ -89,11 +91,11 @@ from transformers import TextStreamer
|
|
| 89 |
device = "cuda" # the device to load the model onto
|
| 90 |
|
| 91 |
model = AutoModelForCausalLM.from_pretrained(
|
| 92 |
-
"SeaLLMs/
|
| 93 |
torch_dtype=torch.bfloat16,
|
| 94 |
device_map=device
|
| 95 |
)
|
| 96 |
-
tokenizer = AutoTokenizer.from_pretrained("SeaLLMs/
|
| 97 |
|
| 98 |
# prepare messages to model
|
| 99 |
messages = [
|
|
|
|
| 20 |
<p align="center">
|
| 21 |
<a href="https://damo-nlp-sg.github.io/SeaLLMs/" target="_blank" rel="noopener">Website</a>
|
| 22 |
|
| 23 |
+
<a href="https://huggingface.co/SeaLLMs/SeaLLMs-v3-7B-Chat" target="_blank" rel="noopener"> 🤗 Tech Memo</a>
|
| 24 |
|
| 25 |
<a href="https://huggingface.co/spaces/SeaLLMs/SeaLLM-Chat" target="_blank" rel="noopener"> 🤗 DEMO</a>
|
| 26 |
|
|
|
|
| 40 |
|
| 41 |
SeaLLMs is tailored for handling a wide range of languages spoken in the SEA region, including English, Chinese, Indonesian, Vietnamese, Thai, Tagalog, Malay, Burmese, Khmer, Lao, Tamil, and Javanese.
|
| 42 |
|
| 43 |
+
This page introduces the **SeaLLMs-v3-7B-Chat** model, specifically fine-tuned to follow human instructions effectively for task completion, making it directly applicable to your applications.
|
| 44 |
+
|
| 45 |
+
You may also refer to the [SeaLLMs-v3-1.5B-Chat](https://huggingface.co/SeaLLMs/SeaLLMs-v3-1.5B-Chat) model which requires much lower computational resources and can be easily loaded locally.
|
| 46 |
|
| 47 |
|
| 48 |
### Get started with `Transformers`
|
|
|
|
| 55 |
device = "cuda" # the device to load the model onto
|
| 56 |
|
| 57 |
model = AutoModelForCausalLM.from_pretrained(
|
| 58 |
+
"SeaLLMs/SeaLLMs-v3-7B-Chat", # can change to "SeaLLMs/SeaLLMs-v3-1.5B-Chat" if your resource is limited
|
| 59 |
torch_dtype=torch.bfloat16,
|
| 60 |
device_map=device
|
| 61 |
)
|
| 62 |
+
tokenizer = AutoTokenizer.from_pretrained("SeaLLMs/SeaLLMs-v3-7B-Chat")
|
| 63 |
|
| 64 |
# prepare messages to model
|
| 65 |
prompt = "Hiii How are you?"
|
|
|
|
| 91 |
device = "cuda" # the device to load the model onto
|
| 92 |
|
| 93 |
model = AutoModelForCausalLM.from_pretrained(
|
| 94 |
+
"SeaLLMs/SeaLLMs-v3-7B-Chat", # can change to "SeaLLMs/SeaLLMs-v3-1.5B-Chat" if your resource is limited
|
| 95 |
torch_dtype=torch.bfloat16,
|
| 96 |
device_map=device
|
| 97 |
)
|
| 98 |
+
tokenizer = AutoTokenizer.from_pretrained("SeaLLMs/SeaLLMs-v3-7B-Chat")
|
| 99 |
|
| 100 |
# prepare messages to model
|
| 101 |
messages = [
|