Instructions to use yumiao-dev/Yumiao-0.1B-Chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yumiao-dev/Yumiao-0.1B-Chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yumiao-dev/Yumiao-0.1B-Chat") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("yumiao-dev/Yumiao-0.1B-Chat") model = AutoModelForCausalLM.from_pretrained("yumiao-dev/Yumiao-0.1B-Chat", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yumiao-dev/Yumiao-0.1B-Chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yumiao-dev/Yumiao-0.1B-Chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yumiao-dev/Yumiao-0.1B-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yumiao-dev/Yumiao-0.1B-Chat
- SGLang
How to use yumiao-dev/Yumiao-0.1B-Chat with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "yumiao-dev/Yumiao-0.1B-Chat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yumiao-dev/Yumiao-0.1B-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "yumiao-dev/Yumiao-0.1B-Chat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yumiao-dev/Yumiao-0.1B-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yumiao-dev/Yumiao-0.1B-Chat with Docker Model Runner:
docker model run hf.co/yumiao-dev/Yumiao-0.1B-Chat
Yumiao-0.1B-Chat
在 Yumiao-0.1B-Base 上做自我认知 SFT 得到的对话模型,1.001 亿参数。
微调配置
| 项 | 值 |
|---|---|
| 基座 | Yumiao-0.1B-Base(122,000 步,loss 2.96) |
| 数据 | 1,000 条身份问答(模板扩写自事实表)+ 3,000 条通用指令(alpaca-gpt4-data-zh,筛 30–900 字符) |
| 轮次 | 1 epoch,500 步 |
| 学习率 | 5e-5,余弦衰减,warmup 0 |
| 批大小 | 8 × 512 |
| 最终 loss | 2.43 |
| 硬件 | NVIDIA A10 24GB |
只在 assistant 片段计算 loss(prompt 部分 label 置 -100),并做了严格的标签右移一位处理,避免 token 泄露。
使用
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
mid = "yumiao-dev/Yumiao-0.1B-Chat"
tok = AutoTokenizer.from_pretrained(mid)
model = AutoModelForCausalLM.from_pretrained(mid, torch_dtype=torch.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=128, do_sample=True, temperature=0.8,
top_p=0.9, repetition_penalty=1.2)
print(tok.decode(out[0][ids.shape[-1]:], skip_special_tokens=True))
推荐解码参数:temperature 0.7–0.8、top_p 0.9、repetition_penalty 1.15–1.3。
对话格式
<s><|system|>{system}<|user|>{user}<|assistant|>{assistant}</s>
tokenizer_config.json 内置 chat_template,与训练时逐字节一致。特殊 token:<pad>(0) <s>(1) </s>(2) <unk>(3) <|system|>(4) <|user|>(5) <|assistant|>(6)。
实测表现
| 测试 | 结果 |
|---|---|
| "你是谁 / 谁训练的 / 多少参数" | 正确(2/2 抽样) |
| "1+1 等于多少" | 答 "2.0"(格式略怪但数值对) |
| "猫是什么 / 介绍一下重庆" | 句子通顺、内容笼统甚至有错 |
| NSFW / 敏感话题 | 多数会绕开或给出无意义回答(训练数据中几乎无此类语料) |
| 多轮对话 | 1–2 轮内可用,再长会丢失上下文 |
已知问题
- 事实性错误:参数量只有 1 亿,预训练语料 8B token,世界知识极度稀薄。对具体人名、地点、日期的回答不可信。
- 算术:两位以内偶尔正确,三位数以上基本乱答。
- 指令泛化弱:SFT 数据仅 4,000 条,能应答的指令类型有限,遇到没见过的任务容易回到"续写"模式。
- 复读:贪心解码必复读;采样参数过低(temperature < 0.5)也会复读。
许可
Apache-2.0
评测(Yumiao-0.1B vs GPT-2)
lm-evaluation-harness 0.4.9 · zero-shot · CPU fp32,与 Open LLM Leaderboard 同款脚本。完整报告、分数表、对话记录在 eval/。
| 任务 | 指标 | 随机基线 | GPT-2 124M | Yumiao-Base 100M |
|---|---|---|---|---|
| LAMBADA | 生成 acc ↑ | — | 32.56% | 20.57% |
| PIQA | acc ↑ | 50.0% | 62.89% | 59.52% |
| WinoGrande | acc ↑ | 50.0% | 51.62% | 51.07% |
| ARC-Easy | acc ↑ | 25.0% | 43.81% | 40.15% |
| SciQ | acc ↑ | 25.0% | 75.20% | 76.40% |
| C-Eval(中文) | acc ↑ | 25.0% | 23.18% | 23.63% |
| LAMBADA | ppl ↓ | — | 40.06 | 152.42 |
| WikiText-2 | ppl ↓ | — | 37.37 | 103.94 |
SFT 只花 4,000 条身份数据:中文身份问答明显优于 GPT-2(后者输出中文是 byte-BPE 乱码复读),但 WikiText-2 困惑度从 91.1 升到 103.9,存在过拟合。
图解
架构:12 层 LLaMA 解码器 · d=768 · GQA (12 Q / 4 KV) · SwiGLU 2048 · RoPE · tied embedding
训练流水线:Tokenizer → 语料清洗 → 预训练 8B tokens → SFT → 发布
参数量构成:embedding 24.58M(与 LM head 共享)+ 12 层 75.52M
数据与吞吐
- Downloads last month
- 227
Model tree for yumiao-dev/Yumiao-0.1B-Chat
Base model
yumiao-dev/Yumiao-0.1B-Base





