1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_name = "trillionlabs/Tri-7B"
5
6model = AutoModelForCausalLM.from_pretrained(
7 model_name,
8 torch_dtype=torch.bfloat16,
9 device_map="auto"
10)
11tokenizer = AutoTokenizer.from_pretrained(model_name)
12
13prompt = "Explain the concept of quantum computing in simple terms."
14messages = [
15 {"role": "user", "content": prompt}
16]
17text = tokenizer.apply_chat_template(
18 messages,
19 tokenize=False,
20 add_generation_prompt=True
21)
22model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
23
24generated_ids = model.generate(
25 **model_inputs,
26 max_new_tokens=512
27)
28generated_ids = [
29 output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
30]
31
32response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
33print(response)
1# vLLM
2vllm serve trillionlabs/Tri-7B --dtype bfloat16 --max-model-len 32768
3
4# vLLM with custom options
5vllm serve trillionlabs/Tri-7B \
6 --dtype bfloat16 \
7 --max-model-len 32768 \
8 --gpu-memory-utilization 0.95 \
9 --port 8000
1# SGLang
2python3 -m sglang.launch_server --model-path trillionlabs/Tri-7B --dtype bfloat16
3
4# SGLang with custom options
5python3 -m sglang.launch_server \
6 --model-path trillionlabs/Tri-7B \
7 --dtype bfloat16 \
8 --context-length 32768 \
9 --port 30000 \
10 --host 0.0.0.0
We evaluated Tri-7B across a comprehensive suite of benchmarks assessing general reasoning, knowledge recall, coding abilities, mathematical reasoning, and instruction-following capabilities. Compared to our previous generation model Trillion-7B-preview, Tri-7B achieves significant gains across all domains.
This model is licensed under the Apache License 2.0.
For inquiries, please contact:
info@trillionlabs.co