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/check-status.js from masterofthestars/tianxuan: direct link, hf CLI and curl.
- Browser
- Download file 2.55 kB
-
https://huggingface.co/masterofthestars/tianxuan/resolve/main/scripts/check-status.js
- Command line
-
hf download hf://masterofthestars/tianxuan/scripts/check-status.js
-
curl -L -o check-status.js https://huggingface.co/masterofthestars/tianxuan/resolve/main/scripts/check-status.js
2.55 kB
| /** | |
| * 天玄 TianXuan - 快速状态检查 | |
| */ | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const checkpointDir = process.argv[2] || 'data/checkpoints_v3'; | |
| const metaPath = path.join(checkpointDir, 'meta.json'); | |
| if (!fs.existsSync(metaPath)) { | |
| console.log(`⚠️ 检查点不存在:${checkpointDir}`); | |
| console.log(''); | |
| console.log('可用的检查点:'); | |
| const dataDir = 'data'; | |
| if (fs.existsSync(dataDir)) { | |
| const dirs = fs.readdirSync(dataDir).filter(d => | |
| fs.statSync(path.join(dataDir, d)).isDirectory() && d.startsWith('checkpoints') | |
| ); | |
| for (const d of dirs) { | |
| const meta = path.join(dataDir, d, 'meta.json'); | |
| if (fs.existsSync(meta)) { | |
| const m = JSON.parse(fs.readFileSync(meta, 'utf8')); | |
| console.log(` ${d}: ${m.t || 0} 步, ${m.corpusTokens?.toLocaleString() || 0} 字符`); | |
| } | |
| } | |
| } | |
| process.exit(0); | |
| } | |
| const meta = JSON.parse(fs.readFileSync(metaPath, 'utf8')); | |
| const now = new Date(); | |
| console.log('='.repeat(50)); | |
| console.log('天玄训练状态监控'); | |
| console.log('='.repeat(50)); | |
| console.log(`时间:${now.toLocaleString('zh-CN')}`); | |
| console.log(''); | |
| console.log(`检查点:${checkpointDir}`); | |
| console.log(`训练步数:${meta.t} 步`); | |
| console.log(`语料长度:${meta.corpusTokens?.toLocaleString() || 0} 字符`); | |
| console.log(`词表大小:${meta.config?.vocabSize || 0}`); | |
| console.log(''); | |
| console.log('在线学习机制:'); | |
| console.log(` STDP: ${meta.stdp ? '✓' : '✗'} ${meta.stdpState ? `(已更新 ${meta.stdpState.stepCount} 次)` : ''}`); | |
| console.log(` STDA: ${meta.stda ? '✓' : '✗'} ${meta.stdaState ? `(阈值偏移 ${meta.stdaState.thresholdShift.toFixed(4)})` : ''}`); | |
| console.log(` Titans: ${meta.onlineTitans ? '✓' : '✗'} ${meta.titansWriteLog?.length ? `(${meta.titansWriteLog.length} 条)` : ''}`); | |
| console.log(` Replay: ${meta.replay ? '✓' : '✗'} ${meta.replayState ? `(${meta.replayState.buffer?.length || 0}/${meta.replayState.maxCapacity})` : ''}`); | |
| console.log(''); | |
| // 计算训练时间 | |
| const trainedAt = new Date(meta.trainedAt); | |
| const elapsed = now - trainedAt; | |
| const minutes = Math.floor(elapsed / 60000); | |
| console.log(`最后更新:${meta.trainedAt}`); | |
| console.log(`距今:${minutes} 分钟`); | |
| console.log(''); | |
| // 状态判断 | |
| if (meta.t >= 1000) { | |
| console.log('✅ 训练完成 (≥1000步)'); | |
| } else if (meta.t >= 100) { | |
| console.log('🔄 训练中 (已训练 100+ 步)'); | |
| } else { | |
| console.log('⏳ 刚开始训练'); | |
| } | |
| console.log('='.repeat(50)); | |