legacy-datasets/wikipedia
Updated • 39.5k • 688
How to use lijie1228/liemo-gpt-mini with llama.cpp:
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf lijie1228/liemo-gpt-mini:F16 # Run inference directly in the terminal: llama cli -hf lijie1228/liemo-gpt-mini:F16
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf lijie1228/liemo-gpt-mini:F16 # Run inference directly in the terminal: llama cli -hf lijie1228/liemo-gpt-mini:F16
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf lijie1228/liemo-gpt-mini:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf lijie1228/liemo-gpt-mini:F16
docker model run hf.co/lijie1228/liemo-gpt-mini:F16
How to use lijie1228/liemo-gpt-mini with Ollama:
ollama run hf.co/lijie1228/liemo-gpt-mini:F16
How to use lijie1228/liemo-gpt-mini with Docker Model Runner:
docker model run hf.co/lijie1228/liemo-gpt-mini:F16
How to use lijie1228/liemo-gpt-mini with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull lijie1228/liemo-gpt-mini:F16
lemonade run user.liemo-gpt-mini-F16
lemonade list
两个相互独立、从零训练的中文 decoder-only GPT 模型(char 字符级词表), 连同各自的 FP16 权重与 GGUF 量化版本,全部收录在本仓库。
这两个模型不是从任何开源大模型裁剪/蒸馏而来,模型定义、词表、语料处理、训练脚本全部手写。 训练硬件:单张 GTX 1650 4GB,PyTorch 2.0.1+cu117。
| 模型 | 参数量 | 架构 | 训练语料 | 用途定位 | 100 题测评 |
|---|---|---|---|---|---|
| 烈模 Liemo 64M | 63,741,600(63.74M) | 12 层 / 8 头 / 624 维 / 上下文 128 | 5.02 亿 token 中文 wiki + 日常对话,预训练后做多轮 SFT | 中文问答 / 闲聊 | 94 / 100 |
| 烈模-mini 32M | 33,486,336(33.49M) | 9 层 / 8 头 / 512 维 / 上下文 128 | 2.2 亿 token(95% 日常对话 + 5% wiki),预训练 + 轻量 SFT | 日常对话续写 / 资源受限部署 | 13 / 100 |
两者无任何关联:各自的词表、token 流、权重完全独立训练。
liemo-64m/
weights/best_fp16.pt # 64M 最优权重(94分),PyTorch 格式
gguf/liemo-f16.gguf # 64M FP16 GGUF,107.2 MB
gguf/liemo-q8_0.gguf # 64M Q8_0 GGUF,56.9 MB
liemo-32m/
weights/best_fp16.pt # 32M 最优权重(SFT v3),PyTorch 格式
gguf/liemo32-f16.gguf # 32M FP16 GGUF,64.0 MB
gguf/liemo32-q8_0.gguf # 32M Q8_0 GGUF,38.6 MB
torch.nn.functional.scaled_dot_product_attention,数学等价于手写 tril 掩码lm_head.weight 与 wte.weight 权重共享(tie)| 配置 | 64M | 32M |
|---|---|---|
| n_layer | 12 | 9 |
| n_head | 8 | 8 |
| n_embd | 624 | 512 |
| block_size | 128 | 128 |
| vocab_size | 12056 | 9896 |
| 参数量 | 63,741,600 | 33,486,336 |
注:64M 的 624 维不能被 GGML 量化块大小(32/256)整除,导致其 Q8_0 只能逐行量化、K-quants 无法使用;32M 的 512 维可整除,GGUF 量化更友好。
| 维度 | 烈模 64M | 烈模-mini 32M |
|---|---|---|
| 知识-地理历史 | 19/20 (95%) | 0/20 (0%) |
| 知识-科学文学 | 20/20 (100%) | 1/20 (5%) |
| 寒暄问候 | 18/20 (90%) | 4/20 (20%) |
| 情绪安慰 | 18/20 (90%) | 4/20 (20%) |
| 日常应答 | 19/20 (95%) | 4/20 (20%) |
| 总分 | 94/100 (94%) | 13/100 (13%) |
同题输出对比:
| 问 | 烈模 64M | 烈模-mini 32M |
|---|---|---|
| 你好 | 你好,很高兴见到你 | (空) |
| 中国首都在哪 | 中国的首都在北京 | 必须的,群里不许潜水 |
| 我考砸了 | 一次没考好说明不了什么 | 欸,联考考得怎么样 |
| 水的化学式 | H₂O | (wiki 片段乱码) |
差距根源不是参数量,而是数据:64M 用了人工构造的知识问答 + 多轮迭代;32M 只有生活对话接话数据,学会的是「接话」而非「答题」。32M 的日常接话其实很自然(如「周末去哪玩→想去东台,老街特别好看」),只是不符合标准答案关键词。
gguf Python 库版本仅实现 Q8_0 量化,K-quants(Q2_K~Q6_K)调用报 NotImplementedError,故本仓库只提供 FP16 与 Q8_0.pt 权重需配合模型定义(本仓库不含 model.py,如需要请自行按上述架构实现;两个权重文件内的 cfg 字段已含完整配置)MIT License。可自由使用、修改、分发,请保留署名。
8-bit
16-bit