Morton-Li/ChineseWebText2.0-HighQuality
Viewer • Updated • 155M • 3.16k • 4
A ~20.88M-parameter GPT I trained from scratch on Chinese web text on a single Apple M4 Mac. It is meant for studying how a small decoder-only model behaves end to end, not for production text generation.
from huggingface_hub import hf_hub_download
ckpt = hf_hub_download("guicybercode/zh-news-gpt-20m", "pytorch_model.bin")
tok = hf_hub_download("guicybercode/zh-news-gpt-20m", "tokenizer.model")
| Attribute | Value |
|---|---|
| Architecture | GPT ( decoder-only transformer ) |
| Parameters | ~20.88M |
| Vocabulary size | 8,000 tokens |
| Context length | 256 tokens |
| Tokenizer | SentencePiece (BPE) |
{
"vocab_size": 8000,
"n_positions": 256,
"n_ctx": 256,
"n_embd": 384,
"n_layer": 10,
"n_head": 6,
"block_size": 256,
"dropout": 0.1,
"bias": false
}
Morton-Li/ChineseWebText2.0-HighQuality (Chinese web corpus)Training was continued until 100,000 steps, but I observed signs of overfitting and a slight degradation in generation quality after 93,000 steps. For that reason, I selected the 93,000-step checkpoint as the stable final release of this model.
| Metric | Value |
|---|---|
| Training loss (approx.) | 4.45 |
| Validation loss (approx.) | 4.85 |
| Perplexity | 141.83 |
Generated with temperature=0.8, top_k=50, top_p=0.95.
今天天气偏暖,是以"低碳化"为主题的城市.从温州市雨水局的气象分析,由于风水温度的下降,风水的强度和风水的强度明显,天气的下降,风水天气的低温和风水的强度下降,是为多地少数地区雨水的最低气温. 今天天气偏暖,气温低迷,天气的天气,天气也让天气的雪雪天气和冷
人工智能.在其中,新能源汽车新能源汽车领域,新能源汽车行业的规模持续提升,新能源汽车产业链成为新能源汽车产业链和产业链,同时也成为新能源汽车领域,新能源汽车企业与新能源汽车品牌相匹配.新能源汽车行业在新能源汽车行业中发展具有重大贡献,新能源汽车产业集群也成为新能源汽车产业链产业链的重要组成部分.新能源汽车公司在新能源汽车领域发展具有重要地位,新能源汽车在新能源汽车领域仍将具有较大
中国经济发展有限公司、中国交通银行股份有限公司上海分行、中国银行股份有限公司上海分行、中国银行股份有限公司上海分行、中国银行股份有限公司上海分行、中国银行股份有限公司上海分行、中国银行股份有限公司上海分行、上海分行、上海银行股份有限公司上海分行、中国银行股份有限公司上海分行、中国银行股份有限公司上海分行、中国银行股份有限公司上海分行、上海分行、中国银行股份有限公司上海分行、中国银行股份有限公司上海分行、中国银行股份有限公司上海
import sentencepiece as spm
import torch
checkpoint = torch.load("pytorch_model.bin", map_location="cpu")
sp = spm.SentencePieceProcessor(model_file="tokenizer.model")
input_ids = sp.encode("今天天气", out_type=int)
idx = torch.tensor([input_ids], dtype=torch.long)
MIT, as declared in the repo metadata.