Instructions to use inclusionAI/Ling-1T with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inclusionAI/Ling-1T with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="inclusionAI/Ling-1T", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("inclusionAI/Ling-1T", trust_remote_code=True, device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use inclusionAI/Ling-1T with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inclusionAI/Ling-1T" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inclusionAI/Ling-1T", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/inclusionAI/Ling-1T
- SGLang
How to use inclusionAI/Ling-1T 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 "inclusionAI/Ling-1T" \ --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": "inclusionAI/Ling-1T", "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 "inclusionAI/Ling-1T" \ --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": "inclusionAI/Ling-1T", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use inclusionAI/Ling-1T with Docker Model Runner:
docker model run hf.co/inclusionAI/Ling-1T
Update README.md
Browse files
README.md
CHANGED
|
@@ -152,7 +152,7 @@ Note: If you are interested in previous version, please visit the past model col
|
|
| 152 |
|
| 153 |
### 🚀 Try Online
|
| 154 |
|
| 155 |
-
You can experience Ling-1T online at: [ZenMux](https://zenmux.ai/inclusionai/
|
| 156 |
|
| 157 |
### 🔌 API Usage
|
| 158 |
|
|
@@ -172,7 +172,7 @@ client = OpenAI(
|
|
| 172 |
# 4. Make a request
|
| 173 |
completion = client.chat.completions.create(
|
| 174 |
# 5. Specify the model to use in the format "provider/model-name"
|
| 175 |
-
model="inclusionai/
|
| 176 |
messages=[
|
| 177 |
{
|
| 178 |
"role": "user",
|
|
@@ -191,7 +191,7 @@ Here is a code snippet to show you how to use the chat model with `transformers`
|
|
| 191 |
```python
|
| 192 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 193 |
|
| 194 |
-
model_name = "inclusionAI/
|
| 195 |
|
| 196 |
model = AutoModelForCausalLM.from_pretrained(
|
| 197 |
model_name,
|
|
@@ -246,11 +246,11 @@ pip install vllm==0.11.0
|
|
| 246 |
from transformers import AutoTokenizer
|
| 247 |
from vllm import LLM, SamplingParams
|
| 248 |
|
| 249 |
-
tokenizer = AutoTokenizer.from_pretrained("inclusionAI/
|
| 250 |
|
| 251 |
sampling_params = SamplingParams(temperature=0.7, top_p=0.8, repetition_penalty=1.05, max_tokens=16384)
|
| 252 |
|
| 253 |
-
llm = LLM(model="inclusionAI/
|
| 254 |
prompt = "Give me a short introduction to large language models."
|
| 255 |
messages = [
|
| 256 |
{"role": "system", "content": "You are Ling, an assistant created by inclusionAI"},
|
|
@@ -269,7 +269,7 @@ outputs = llm.generate([text], sampling_params)
|
|
| 269 |
#### Online Inference:
|
| 270 |
|
| 271 |
```bash
|
| 272 |
-
vllm serve inclusionAI/
|
| 273 |
--tensor-parallel-size 32 \
|
| 274 |
--pipeline-parallel-size 1 \
|
| 275 |
--trust-remote-code \
|
|
|
|
| 152 |
|
| 153 |
### 🚀 Try Online
|
| 154 |
|
| 155 |
+
You can experience Ling-1T online at: [ZenMux](https://zenmux.ai/inclusionai/ling-1t?utm_source=hf_inclusionAI)
|
| 156 |
|
| 157 |
### 🔌 API Usage
|
| 158 |
|
|
|
|
| 172 |
# 4. Make a request
|
| 173 |
completion = client.chat.completions.create(
|
| 174 |
# 5. Specify the model to use in the format "provider/model-name"
|
| 175 |
+
model="inclusionai/ling-1t",
|
| 176 |
messages=[
|
| 177 |
{
|
| 178 |
"role": "user",
|
|
|
|
| 191 |
```python
|
| 192 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 193 |
|
| 194 |
+
model_name = "inclusionAI/ling-1t"
|
| 195 |
|
| 196 |
model = AutoModelForCausalLM.from_pretrained(
|
| 197 |
model_name,
|
|
|
|
| 246 |
from transformers import AutoTokenizer
|
| 247 |
from vllm import LLM, SamplingParams
|
| 248 |
|
| 249 |
+
tokenizer = AutoTokenizer.from_pretrained("inclusionAI/ling-1t")
|
| 250 |
|
| 251 |
sampling_params = SamplingParams(temperature=0.7, top_p=0.8, repetition_penalty=1.05, max_tokens=16384)
|
| 252 |
|
| 253 |
+
llm = LLM(model="inclusionAI/ling-1t", dtype='bfloat16', trust_remote_code=True)
|
| 254 |
prompt = "Give me a short introduction to large language models."
|
| 255 |
messages = [
|
| 256 |
{"role": "system", "content": "You are Ling, an assistant created by inclusionAI"},
|
|
|
|
| 269 |
#### Online Inference:
|
| 270 |
|
| 271 |
```bash
|
| 272 |
+
vllm serve inclusionAI/ling-1t \
|
| 273 |
--tensor-parallel-size 32 \
|
| 274 |
--pipeline-parallel-size 1 \
|
| 275 |
--trust-remote-code \
|