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/train-full.sh from masterofthestars/tianxuan: direct link, hf CLI and curl.
- Browser
- Download file 1.63 kB
-
https://huggingface.co/masterofthestars/tianxuan/resolve/main/scripts/train-full.sh
- Command line
-
hf download hf://masterofthestars/tianxuan/scripts/train-full.sh
-
curl -L -o train-full.sh https://huggingface.co/masterofthestars/tianxuan/resolve/main/scripts/train-full.sh
1.63 kB
| # ============================================================ | |
| # 天玄完整训练脚本(可复现) | |
| # 用法: bash scripts/train-full.sh [续训] | |
| # 首次训练: bash scripts/train-full.sh | |
| # 续训: bash scripts/train-full.sh resume | |
| # ============================================================ | |
| set -euo pipefail | |
| cd "$(dirname "$0")/.." | |
| CK="sandbox/ck-full-multi" | |
| LOG_DIR="sandbox/logs" | |
| # 确保沙箱编译产物存在 | |
| if [ ! -d "sandbox/dist/ml" ]; then | |
| echo "[*] 首次运行, 编译 TypeScript → sandbox/dist ..." | |
| rm -rf sandbox/dist | |
| npx tsc --outDir sandbox/dist | |
| fi | |
| # 确保语料存在 | |
| if [ ! -f "data/corpus.txt" ] || [ "$(wc -c < data/corpus.txt)" -lt 100000 ]; then | |
| echo "[*] 生成训练语料(500万字符)..." | |
| node -e " | |
| const { buildCorpus } = require('./sandbox/dist/src/ml/data'); | |
| const fs = require('fs'); | |
| fs.mkdirSync('data', { recursive: true }); | |
| const b = buildCorpus({ seed: 7, tokens: 5000000, rawPerFile: 30000 }); | |
| fs.writeFileSync('data/corpus.txt', b.text, 'utf-8'); | |
| console.log('语料: ' + b.text.length + ' 字符'); | |
| " | |
| fi | |
| mkdir -p "$LOG_DIR" | |
| if [ "${1:-}" = "resume" ] && [ -f "$CK/meta.json" ]; then | |
| echo "[*] 续训模式: 从 $CK 检查点继续" | |
| cd sandbox | |
| exec node ../sandbox/dist/src/ml/train.js \ | |
| --resume ck-full-multi \ | |
| --epochs 2 --lr 0.002 --ckpt 50 --out ck-full-multi | |
| else | |
| echo "[*] 从头训练" | |
| cd sandbox | |
| exec node ../sandbox/dist/src/ml/train.js \ | |
| --tokens 5000000 --epochs 2 --lr 0.002 \ | |
| --hidden 256 --emb 64 --bptt 32 \ | |
| --attn 1 --mamba 1 --cnn 1 \ | |
| --ckpt 50 --out ck-full-multi | |
| fi | |