Downloads · 30 days
3
11% of all-time downloads
eshaoliu/minimind-1536-pretrain
minimind-1536-pretrain is a machine learning model from eshaoliu. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
MiniMind 1B 英文数学基座模型(32 层 / 994M 参数),由 ultra-minimind 项目基于 Nemotron-CC-Math-v1 高质量英文数学语料流式预训练而成。权重以 Qwen3 兼容布局导出为标准 HF safetensors 格式,官方 transformers 直接加载,无需 trustremotecode。
Downloads · 30 days
3
11% of all-time downloads
All-time downloads
27
Public
Parameters
994M
2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2 GB · 100%
From the Hugging Face model README
MiniMind 1B 英文数学基座模型(32 层 / 994M 参数),由 ultra-minimind 项目基于 Nemotron-CC-Math-v1 高质量英文数学语料流式预训练而成。权重以 Qwen3 兼容布局导出为标准 HF safetensors 格式,官方 transformers 直接加载,无需 trust_remote_code。
⚠️ 这是预训练基座模型(base model),未经过 SFT/指令微调,不具备对话能力,GSM8K 等评测表现为裸 few-shot 补全水平。适合做继续预训练/微调的起点。
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("eshaoliu/minimind-1536-pretrain")
model = AutoModelForCausalLM.from_pretrained(
"eshaoliu/minimind-1536-pretrain", torch_dtype="auto", device_map="cuda"
)
prompt = "The derivative of x^2 is"
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=100, do_sample=True, temperature=0.85, top_p=0.85)
print(tok.decode(out[0], skip_special_tokens=True))
也可用 ModelScope SDK:
from modelscope import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("eshaoliu/minimind-1536-pretrain")
model = AutoModelForCausalLM.from_pretrained("eshaoliu/minimind-1536-pretrain")
| 项目 | 值 |
|---|---|
| 参数量 | 994.2M(embedding 与 lm_head 绑定,只存一份) |
| 层数 / 隐藏维度 | 32 / 1536 |
| 注意力头 | 8 头,head_dim=192,GQA 4 KV 头,无 bias,qk-norm |
| FFN | SwiGLU,intermediate=4864 |
| 词表 | 32768(英文 BPE,tokenizer_en) |
| 位置编码 | RoPE(θ=1e6),最大 32K 上下文 |
| 精度 | fp16 |
权重命名为 Qwen3 标准布局(model.layers.N.self_attn.q_proj 等),config.json 中 architectures: ["Qwen3ForCausalLM"],任何支持 Qwen3 的推理框架(vLLM、llama.cpp 转换等)均可直接消费。
ultra-minimind/trainer/train_pretrain.py(流式预训练管线,完整 resume 支持)4+ 质量分桶,流式读取,按 1024 token 定长 packing;flash-attn 变长注意力(flash_attn_varlen)按文档边界隔离注意力torch.compile + 梯度检查点;每优化步 16 micro-batch × 16 累积 × 1024 token ≈ 26.2 万 tokenfrom_weight/skip_samples 机制衔接;实验记录见 SwanLab @eshaoliu/MiniMind-Pretrain)。日志段起点 loss ≈ 7.01(ppl ≈ 1110),持续下降至收敛区间| 权重 | 准确率 |
|---|---|
| step 13000 中间快照 | 1.67% |
| step 15000 中间快照 | 1.82% |
| step 18000 中间快照 | 1.82% |
| 本仓库最终权重 | 1.59% |
基座模型 few-shot 补全格式不稳定,该结果仅作训练过程参照,不代表微调后水平。
model.safetensors:fp16 权重(~1.9GB)config.json / generation_config.json:Qwen3 架构配置与默认生成参数tokenizer.json / tokenizer_config.json / special_tokens_map.json:英文 BPE 分词器Apache 2.0(见 ultra-minimind 仓库 LICENSE)。