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: 2,302 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 77 78 79 | #!/usr/bin/env node
/**
* 天玄 TianXuan - 集成训练脚本
* 启动完整集成的训练,包含感受模块、上下文窗口、工具系统
*/
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
console.log('='.repeat(70));
console.log('天玄 TianXuan - 集成训练启动');
console.log('='.repeat(70));
console.log('');
// 检查当前训练状态
const checkpointDir = 'data/checkpoints_v3';
const metaPath = path.join(checkpointDir, 'meta.json');
if (fs.existsSync(metaPath)) {
const meta = JSON.parse(fs.readFileSync(metaPath, 'utf8'));
console.log(`当前检查点:${checkpointDir}`);
console.log(`已训练步数:${meta.t} 步`);
console.log(`语料长度:${meta.corpusTokens?.toLocaleString() || 0} 字符`);
console.log('');
// 检查是否需要继续训练
if (meta.t < 1000) {
console.log('⚠ 训练步数不足 1000 步,继续训练...');
console.log('');
} else {
console.log('✓ 已达到目标步数 (1000+)');
console.log('');
}
} else {
console.log('⚠ 检查点不存在,从头开始训练...');
console.log('');
}
// 构建训练命令
const trainCmd = 'npm run train -- --realcorpus 0 --tokens 10000000 --epochs 10 --stdp 1 --stda 1 --out data/checkpoints_v4 --seed 42';
console.log('【训练配置】');
console.log(`命令:${trainCmd}`);
console.log('');
console.log('【启用功能】');
console.log(' ✓ STDP (突触时序依赖可塑性)');
console.log(' ✓ STDA (突触阈值适应)');
console.log(' ✓ Titans 记忆');
console.log(' ✓ Replay Buffer');
console.log(' ✓ 多巴胺调制');
console.log(' ✓ MoE 路由');
console.log('');
console.log('【预计】');
console.log(' 训练步数:~20000 步 (10 epochs × 2000 batches)');
console.log(' 预计时间:约 30-60 分钟 (CPU)');
console.log('');
// 启动训练
console.log('【启动训练】');
console.log('='.repeat(70));
console.log('');
try {
const result = execSync(trainCmd, {
cwd: 'C:\\Users\\l1064\\Desktop\\tianxuan',
stdio: 'inherit',
encoding: 'utf8'
});
console.log('');
console.log('✅ 训练完成');
} catch (e) {
console.log('');
console.log('⚠ 训练被中断或出错');
console.log('');
}
console.log('='.repeat(70));
|