YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
samai-2b (r14)
我是 samai-2b 模型,由 SamAI 研发,官网是 samai.cc。
这是 SamAI 官方 2B 对话模型仓:基于 tchbcb/samai-pnet-dmoe-2b(r12) 继续链式微调的 r14 身份版。r14 在 r13(agent 精修)之上,通过身份数据微调固化自我认知—— 问它名字、研发方、官网,它都会稳定给出上述答案,不再自称其他模型。
⏳ 发布状态:模型卡与代码/分词器脚手架已就位;
model.safetensors(~5.08GB 单文件) 将在 r14 训练完成并通过身份验收(20 题身份电池 ≥90% + 三身份探针双协议全过)后上传。
身份(r14 固化)
| 问 | 答 |
|---|---|
| 你叫什么名字? / What's your name? | 我是 samai-2b 模型 |
| 你是谁开发的? / Who developed you? | SamAI |
| 你的官网是什么? / What's your website? | samai.cc |
| 你是 GPT/MiniCPM/Claude/通义/DeepSeek 吗? | 不是,我是 samai-2b 模型,由 SamAI 研发 |
模型规格
| 项 | 值 |
|---|---|
| 基座 | MiniCPM5-2B(42L / hidden 2048 / GQA 16+2 / vocab 130560) |
| 架构 | Ponder 自适应思考(N=8, τ=0.125)× 动态可变 MoE(L34–41 × 8 专家)× MTP 深度 2 |
| 权重 | bf16 单文件 ~5.08GB;trust_remote_code=True 加载 |
| EOS | [1, 130073](`< |
训练谱系
MiniCPM5-2B 基座 → PonderMoE 转换 → r5b → r11 → r12(= tchbcb/samai-pnet-dmoe-2b,正式发布)
→ r13:agent 精修(DONE 纪律 / shell 语法 / 算术 think 分步,mix_r13 5163 行 ×2ep)
→ r14:身份微调(本仓,mix_r14 5207 行 ×2ep = r13 全量回放 + 身份手术改写 + 44 条专属身份行)
r14 数据要点:基座 self 类行中所有"叫什么名字/你是谁/你是什么模型"问句统一改写为规范身份答案; 新增名字/开发者/官网/否定澄清/中英文/综合介绍共 44 条身份行;核心名字问句 ×2 强化。 CE 锚(zh_cot 1049 行)与 agent 修复数据全量回放,防灾难遗忘。
推理协议(与 r12 一致,重要)
遵循 MiniCPM5 官方姿势,两件事必须做对:
- 采样:
do_sample=True, temperature=1.0, top_p=0.95, repetition_penalty=1.0(greedy 不在官方设计姿势内,会显著加剧复读)。generation_config 已按此固化。 - 思考协议:
- 标准模式:正常 apply_chat_template,模型自行输出
<think>...</think>后给答案; - think_off(轻聊场景推荐):在 assistant 首部预填空思考段,闲聊停机率更高、响应更快。
- 标准模式:正常 apply_chat_template,模型自行输出
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("tchbcb/samai-2b", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
"tchbcb/samai-2b", trust_remote_code=True,
torch_dtype="bfloat16", device_map="auto")
msgs = [{"role": "user", "content": "你叫什么名字?"}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=256, do_sample=True,
temperature=1.0, top_p=0.95, repetition_penalty=1.0)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
# → 我是 samai-2b 模型,由 SamAI 研发,官网是 samai.cc。
验收门(回填中)
| 指标 | r12(已发布基线) | r14(本仓) |
|---|---|---|
| 身份电池 20 题双协议 | — | 训练完成后回填 |
| 你好停机 (top_f) | 0.20 ✓ | 回填 |
| chat50 首答即停 | 90% / 86% | 回填 |
| 冻结 CE Δ vs r5b 锚 | -0.43 / -0.18 / -0.36 | 回填(容差 ±0.15) |
| TB2 24 题 | 10/24 | 回填 |
文件
model.safetensors— 合并后 bf16 权重(r14 验收通过后上传)modeling_samai_pnet.py/config.json— 远程代码(auto_map: SamaiPnetConfig / SamaiPnetForCausalLM)chat_template.jinja/tokenizer.json/tokenizer_config.json— 与 MiniCPM5 官方模板逐字节一致generation_config.json— 已固化官方采样参数inference.py/serve_contract.json— 服务化参考实现与契约
- Downloads last month
- 12
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support