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
File size: 3,182 Bytes
db7bc06 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | #!/usr/bin/env bash
# 天玄 TianXuan — 最小 CI 门禁 (宪章第 5/9 条: 机器可查项自动化)
# 用法: bash scripts/ci-gate.sh (本地 / CI 通用)
# 门禁: ① 编译 (tsc) ② 4 个数值内核 gradcheck ③ MoE 专项 ④ 世界模型 gradcheck
# ⑤ generate 冒烟 (健康检查点) ⑥ P0-A 不变量 ⑦ 沙箱纪律 (daily-check)
# 退出码 0=全绿, 非 0=门禁失败。
set -uo pipefail
cd "$(dirname "$0")/.."
NODE="${NODE:-node}"
TSC="node_modules/typescript/bin/tsc"
if [ ! -x "$NODE" ] && ! command -v "$NODE" >/dev/null 2>&1; then
echo "[CI] 未找到 node, 请先安装 (Node >= 18)"; exit 2
fi
step() { echo; echo "════ [CI] $1 ════"; }
fail=0
step "1/7 编译 (tsc --noEmit, strict)"
"$NODE" "$TSC" --noEmit
if [ $? -ne 0 ]; then echo "[CI] tsc 编译失败"; exit 1; fi
echo "[CI] tsc OK"
# 编译产物 (gradcheck/冒烟 需要 sandbox/dist)
step "2/7 编译产物 (tsc → sandbox/dist)"
"$NODE" "$TSC"
if [ $? -ne 0 ]; then echo "[CI] 编译产物失败"; exit 1; fi
echo "[CI] 编译产物 OK"
step "3/7 数值内核 gradcheck (cnn/mamba/snn/transformer)"
for g in cnn mamba snn transformer; do
if [ ! -f "sandbox/gradcheck-$g.js" ]; then
echo "[CI] 缺少 sandbox/gradcheck-$g.js"; fail=1; continue
fi
"$NODE" "sandbox/gradcheck-$g.js" >/dev/null 2>&1
if [ $? -eq 0 ]; then echo "[CI] gradcheck-$g OK"; else echo "[CI] gradcheck-$g FAIL"; fail=1; fi
done
[ $fail -eq 1 ] && { echo "[CI] gradcheck 有失败, 中止"; exit 1; }
step "4/7 MoE 专项 + 世界模型 gradcheck"
"$NODE" "sandbox/dist/src/ml/moe-gradcheck.js" >/dev/null 2>&1 || { echo "[CI] MoE gradcheck FAIL"; exit 1; }
"$NODE" "sandbox/dist/src/ml/wm-gradcheck.js" >/dev/null 2>&1 || { echo "[CI] WM gradcheck FAIL"; exit 1; }
echo "[CI] MoE + WM gradcheck OK"
step "5/7 generate 冒烟 (健康检查点 ck-zh-full)"
CKPT="sandbox/ck-zh-full"
if [ ! -d "$CKPT" ]; then echo "[CI] 缺 $CKPT (需先训练/复制健康检查点)"; exit 1; fi
"$NODE" -e "
const { Engine } = require('./sandbox/dist/src/ml/engine.js');
Engine.load('$CKPT').generate({ prompt: '今天天气', maxLen: 6, seed: 7, budget: 4, temperature: 0.1, topK: 3 })
.then(r => { if (!r.text || r.text.length === 0) { console.error('生成空'); process.exit(1);} })
.catch(e => { console.error(e.message); process.exit(1); });
" >/dev/null 2>&1 || { echo "[CI] generate 冒烟 FAIL"; exit 1; }
echo "[CI] generate 冒烟 OK"
step "6/7 P0-A L0 不变量"
if [ -f "sandbox/dist/sandbox/p0a-invariant.js" ]; then
"$NODE" "sandbox/dist/sandbox/p0a-invariant.js" | grep -q "PASS" || { echo "[CI] P0-A 不变量 FAIL"; exit 1; }
echo "[CI] P0-A 不变量 OK"
else
echo "[CI] P0-A 测试未编译 (跳过, 需 tsc 含 sandbox/p0a-invariant.ts)"
fi
step "7/7 沙箱纪律 (daily-check)"
if [ -f "scripts/daily-check.sh" ]; then
bash scripts/daily-check.sh >/dev/null 2>&1 || { echo "[CI] daily-check 有违规"; fail=1; }
[ $fail -eq 0 ] && echo "[CI] daily-check OK"
fi
if [ $fail -eq 0 ]; then
echo; echo "════ [CI] 全部门禁通过 ✅ ════"; exit 0
else
echo; echo "════ [CI] 存在失败项 ❌ ════"; exit 1
fi
|