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 stellaris/test_closed_loop.py from masterofthestars/tianxuan: direct link, hf CLI and curl.
- Browser
- Download file 2.18 kB
-
https://huggingface.co/masterofthestars/tianxuan/resolve/main/stellaris/test_closed_loop.py
- Command line
-
hf download hf://masterofthestars/tianxuan/stellaris/test_closed_loop.py
-
curl -L -o test_closed_loop.py https://huggingface.co/masterofthestars/tianxuan/resolve/main/stellaris/test_closed_loop.py
2.18 kB
| #!/usr/bin/env python3 | |
| """ | |
| 群星 P8 · Phase 1 闭环不变量测试 (宪章第 7/8 条: 机制可量化) | |
| 用法: python3 -m stellaris.test_closed_loop | |
| 断言: | |
| 1. 感知引擎始终在线 (stop 被拒) | |
| 2. 状态引擎始终在线 (stop 被拒) | |
| 3. 事件流 → Percept 产出 (modality/confidence/anomaly) | |
| 4. 主观时钟只在事件发生时推进 (t_subj = 事件数) | |
| 5. 异常度在突增事件处 > 平稳处 | |
| 6. 健康检查: 正常态 healthy=True, degradation_level=none | |
| """ | |
| from __future__ import annotations | |
| import sys | |
| from pathlib import Path | |
| sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) | |
| from stellaris.main import run_closed_loop | |
| import yaml | |
| def test() -> int: | |
| cfg = yaml.safe_load( | |
| (Path(__file__).resolve().parent / "configs" / "engine_config.yaml").read_text(encoding="utf-8") | |
| ) | |
| s = run_closed_loop(cfg, n_events=10) | |
| # 1 & 2: 始终在线引擎拒 stop | |
| assert s["stopped"]["perception"] is False, "感知引擎 stop 不应成功 (文档 4.1)" | |
| assert s["stopped"]["state"] is False, "状态引擎 stop 不应成功 (文档 4.2)" | |
| # 3: 事件流产出 Percept | |
| assert s["n_events"] == 10 | |
| assert s["perceptual"]["modality"] == "event" | |
| assert 0.0 <= s["perceptual"]["confidence"] <= 1.0 | |
| # 4: 主观时钟 = 事件数 (文档 SubjectiveClock: 只有事件推进) | |
| assert s["t_subj"] == 10.0 | |
| assert s["event_count"] == 10 | |
| # 5: 异常度在突增事件处检出 | |
| assert s["anomaly_peak"] > 0.0, "SNN 脉冲编码未检出异常" | |
| # 6: 健康检查 | |
| for name, h in s["health"].items(): | |
| assert h["healthy"] is True, f"{name} 引擎不健康: {h}" | |
| assert h["degradation_level"] == "none" | |
| # 7: 黑板 z 已建立 (宪章第 2 条) | |
| assert "blackboard" in s, "summary 缺 blackboard 字段" | |
| assert s["blackboard"]["revision"] > 0, "黑板未发生写入 (revision=0)" | |
| assert "state" in s["blackboard"]["keys"], "黑板缺 state 键" | |
| assert "world_model" in s["blackboard"]["keys"], "黑板缺 world_model 键" | |
| print("== P8 Phase 1 闭环不变量: 7/7 通过 ==") | |
| return 0 | |
| if __name__ == "__main__": | |
| sys.exit(test()) | |