Text Generation
Transformers
Chinese
English
character-level
chinese
gru
mamba
Mixture of Experts
titans
Instructions to use masterofthestars/tianxuan with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use masterofthestars/tianxuan with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="masterofthestars/tianxuan")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("masterofthestars/tianxuan", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use masterofthestars/tianxuan with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "masterofthestars/tianxuan" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "masterofthestars/tianxuan", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/masterofthestars/tianxuan
- SGLang
How to use masterofthestars/tianxuan 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 "masterofthestars/tianxuan" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "masterofthestars/tianxuan", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "masterofthestars/tianxuan" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "masterofthestars/tianxuan", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use masterofthestars/tianxuan with Docker Model Runner:
docker model run hf.co/masterofthestars/tianxuan
Tianxuan: full project + data (checkpoints, world_model, data without raw) with correct directory structure
db7bc06 Download scripts/ablation-stdp-stda.sh from masterofthestars/tianxuan: direct link, hf CLI and curl.
- Browser
- Download file 3.08 kB
-
https://huggingface.co/masterofthestars/tianxuan/resolve/main/scripts/ablation-stdp-stda.sh
- Command line
-
hf download hf://masterofthestars/tianxuan/scripts/ablation-stdp-stda.sh
-
curl -L -o ablation-stdp-stda.sh https://huggingface.co/masterofthestars/tianxuan/resolve/main/scripts/ablation-stdp-stda.sh
3.08 kB
| # 天玄 STDP/STDA 消融: 隔离两个机制各自对 top-1 的效应 | |
| # 宪章第 7 条: 无量化证据不允许 enabled — 本脚本出数字填 registry | |
| # 设计: 2×2 矩阵 (stdp × stda), 事件语料 30k × 4ep 同配置, 固定种子 | |
| # 全部在 sandbox/ 内完成(产物 sandbox/dist + sandbox/checkpoints), 不触碰生产 | |
| set -uo pipefail | |
| cd "$(dirname "$0")/.." | |
| TOK=30000; EPOCHS=4; BPTT=16; HIDDEN=96; EMB=32; CTX=8; SEED=7 | |
| # 宪章第4条(多神经协同做真) + 证据门槛: 消融隔离单一变量, 关闭一切非测机制 | |
| # (MoE/Titans/预测/重放/多巴胺/脉冲门控 全部 0), 只切 stdp/stda 开关 | |
| # 合成语料(--realcorpus 0): 事件语料可复现, 不依赖 data/raw (宪章第9条 sandbox 纪律) | |
| COMMON="--tokens $TOK --realcorpus 0 --epochs $EPOCHS --bptt $BPTT --hidden $HIDDEN --emb $EMB --ctx $CTX --seed $SEED --moe 0 --titans 0 --prediction 0 --replay 0 --dopamine 0 --spikethreshold 0 --moeSpike 0 --cleandata 0" | |
| # 编译用本地 node_modules/.bin/tsc (npx 在 node_modules 缺失时会拉错包 tsc@2.0.4) | |
| TSC=./node_modules/.bin/tsc | |
| if [ ! -x "$TSC" ]; then | |
| echo "[setup] node_modules 缺失或 tsc 未装, 先 npm install" | |
| npm install | |
| fi | |
| echo "== 编译 ==" | |
| "$TSC" --noEmit | |
| rm -rf sandbox/dist | |
| "$TSC" | |
| run_cfg() { | |
| local name="$1"; shift | |
| local outdir="sandbox/checkpoints-stdp-stda/$name" | |
| echo "" | |
| echo "=== [$name] $* ===" | |
| rm -rf "$outdir" | |
| # 注意: STDP/STDA 的 rate 参数固定默认值, 不切 | |
| mkdir -p "sandbox/checkpoints-stdp-stda" | |
| # 完整日志落盘(防报错被管道吞), 再筛验证行打印 | |
| if ! node sandbox/dist/src/ml/train.js $COMMON "$@" --out "$outdir" > "sandbox/checkpoints-stdp-stda/$name.log" 2>&1; then | |
| echo " [FAIL] $name 训练失败, 日志尾部:" | |
| tail -30 "sandbox/checkpoints-stdp-stda/$name.log" | |
| return 1 | |
| fi | |
| local hit | |
| hit=$(grep -E '完成 → 验证损失' "sandbox/checkpoints-stdp-stda/$name.log" | tail -1) | |
| if [ -z "$hit" ]; then | |
| echo " [WARN] $name 训练成功但未匹配到验证行, 日志尾部 20 行:" | |
| tail -20 "sandbox/checkpoints-stdp-stda/$name.log" | |
| fi | |
| echo "$hit" | |
| } | |
| echo "" | |
| echo "== 2×2 消融矩阵 (事件语料 30k × 4ep, 固定种子 7) ==" | |
| run_cfg base --stdp 0 --stda 0 | |
| run_cfg stdp --stdp 1 --stda 0 | |
| run_cfg stda --stdp 0 --stda 1 | |
| run_cfg both --stdp 1 --stda 1 | |
| echo "" | |
| echo "== 对比汇总 (取每组最后一轮验证 top-1) ==" | |
| for n in base stdp stda both; do | |
| res=$(grep -E '完成 → 验证损失' "sandbox/checkpoints-stdp-stda/$n.log" | tail -1 || echo "无结果") | |
| echo " $n: $res" | |
| done | |
| echo "" | |
| echo "== 判读 (对照 baseline=base, 阈值 +1.0pt 才算修复缺口) ==" | |
| echo " Δstdp = stdp - base : 若 > +1.0pt → STDP evidence.status=pass; 否则 fail/pending" | |
| echo " Δstda = stda - base : 若 > +1.0pt → STDA evidence.status=pass; 否则 fail/pending" | |
| echo " Δboth = both - base : 叠加效应" | |
| echo "" | |
| echo " 结果目录: sandbox/checkpoints-stdp-stda/" | |
| echo " 把数字回填到 src/station/registry.ts 的 stdp/stda 条目 evidence{baseline,result,status}" | |