Downloads · 30 days
12
20% of all-time downloads
kazama0453/chinese-poker-gpt
chinese-poker-gpt is a machine learning model from kazama0453. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Downloads · 30 days
12
20% of all-time downloads
All-time downloads
59
Public
Repo size
190 MB
Likes
0
Public
Click a slice to open those files.
.pt190 MB · 100%
From the Hugging Face model README
一个从零开始训练的中文语言模型,具备基础的扑克策略问答能力。
本模型完全从零开始训练,不依赖任何预训练权重,记录了一个完整的语言模型训练过程。
| 属性 | 详情 |
|---|---|
| 参数量 | 15.65M |
| 架构 | nanoGPT(Decoder-only Transformer) |
| 词表大小 | 13113 |
| 上下文长度 | 512 tokens |
| 训练硬件 | Apple M4 Pro 48GB |
import pickle
import torch
# 加载词表
with open('meta.pkl', 'rb') as f:
meta = pickle.load(f)
stoi = meta['stoi']
itos = meta['itos']
SPECIAL_TOKENS = ['<|user|>', '<|assistant|>', '<|end|>']
def encode(text):
tokens = []
i = 0
while i < len(text):
matched = False
for special in SPECIAL_TOKENS:
if text[i:i+len(special)] == special:
tokens.append(stoi[special])
i += len(special)
matched = True
break
if not matched:
ch = text[i]
if ch in stoi:
tokens.append(stoi[ch])
i += 1
return tokens
# 推理示例
question = "什么是德州扑克中的位置优势?"
prompt = f"<|user|>{question}<|end|><|assistant|>"
问: 什么是德州扑克中的位置优势?
答: 在扑克中,位置优势是指玩家在有利位置时的策略优势。
完整训练过程记录见作者 GitHub(包含所有参数调试细节和 loss 曲线分析)。
训练目的:学习语言模型训练全链路,作为 AI 产品方向的个人项目。