Views
No views yet

1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_name = "trillionlabs/Tri-21B-Think"
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 = "Solve the following step by step: What is the sum of the first 100 prime numbers?"
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=4096,
27 temperature=0.6,
28 top_p=0.9
29)
30generated_ids = [
31 output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
32]
33
34response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
35print(response)Note on<think>tags: This model was trained without<think>and</think>as special tokens. They were added post-training for compatibility with reasoning parsers. If you plan to fine-tune this model, you'll need to modifytokenizer_config.jsonto avoid indexing errors.
tokenizer_config.json:1"123975": {
2 "content": "<|reserved_special_token_9|>",
3 "lstrip": false,
4 "normalized": false,
5 "rstrip": false,
6 "single_word": false,
7 "special": true
8},
9"123976": {
10 "content": "<|reserved_special_token_10|>",
11 "lstrip": false,
12 "normalized": false,
13 "rstrip": false,
14 "single_word": false,
15 "special": true
16}| Category | Benchmark | Description | Tri-21B-Think |
|---|---|---|---|
| Reasoning | GPQA-Diamond | Graduate-level science questions across physics, chemistry, and biology (PhD-level) | 62.6 |
| AIME 2026 | American Invitational Mathematics Examination 2026 | 56.67 | |
| MMLU-Pro | Massive Multitask Language Understanding with more answer choices and reasoning-focused questions | 74.3 | |
| HLE | Humanity's Last Exam — 2,500 expert-level questions across 100+ subjects created by nearly 1,000 domain experts | 5.52 | |
| Coding | LiveCodeBench v6 | Competitive programming benchmark with problems sourced from recent programming contests | 53.7 |
| SciCode | Code generation across 338 subproblems in 16 natural science fields drawn from real research workflows | 21.3 | |
| MBPP | Python programming benchmark with 500 crowd-sourced problems | 87.83 | |
| HumanEval | Code generation benchmark evaluating functional correctness from docstrings | 84.14 | |
| Instruction Following | IFEval | Tests ability to follow precise formatting and output constraint instructions | 84.7 |
| IFBench | Evaluates generalization to novel, verifiable output constraints not seen during training (Allen AI) | 56.71 | |
| Agentic | TAU2-Bench (Telecom) | Dual-control conversational benchmark where both agent and user use tools to resolve telecom scenarios (Sierra) | 81 |
| AA-LCR | Long-context reasoning over multiple documents at 10K–100K tokens (Artificial Analysis) | 11 | |
| Korean | KMMLU-Pro | 2,822 questions from 14 Korean National Professional Licensure exams (LG AI Research) | 61.54 |
| CLIcK | 1,995 Korean cultural and linguistic knowledge questions sourced from official exams and textbooks (KAIST) | 82.76 | |
| KoBALT | Korean linguistic understanding across syntax, semantics, pragmatics, phonetics, and morphology (SNU) | 54.0 | |
| CSATQA (CoT) | 936 questions from South Korea's College Scholastic Ability Test covering reading, grammar, and writing | 68.98 |