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,981 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 | #!/usr/bin/env node
/**
* 天玄 TianXuan - 感受模块测试
*/
const { SentienceModule } = require('../sandbox/dist/ml/sentience');
console.log('='.repeat(60));
console.log('天玄 TianXuan - 感受模块测试');
console.log('='.repeat(60));
console.log('');
// 创建感受模块
const sentience = new SentienceModule({
emotionRate: 0.01,
homeoRate: 0.005,
motivationStrength: 0.1,
historyLength: 20,
enabled: true,
});
// 模拟训练输入
const testInputs = [
{ loss: 2.0, confidence: 0.6, novelty: 0.3, isSurprise: false, dopamine: 0.0, stdpActivity: 0.5, titansActivity: 0.4 },
{ loss: 1.5, confidence: 0.7, novelty: 0.4, isSurprise: false, dopamine: 0.2, stdpActivity: 0.6, titansActivity: 0.5 },
{ loss: 1.0, confidence: 0.8, novelty: 0.2, isSurprise: false, dopamine: 0.5, stdpActivity: 0.7, titansActivity: 0.6 },
{ loss: 0.8, confidence: 0.9, novelty: 0.1, isSurprise: true, dopamine: 0.8, stdpActivity: 0.8, titansActivity: 0.7 },
{ loss: 1.2, confidence: 0.7, novelty: 0.5, isSurprise: false, dopamine: 0.3, stdpActivity: 0.6, titansActivity: 0.5 },
{ loss: 2.5, confidence: 0.4, novelty: 0.8, isSurprise: true, dopamine: -0.5, stdpActivity: 0.3, titansActivity: 0.2 },
{ loss: 1.8, confidence: 0.6, novelty: 0.3, isSurprise: false, dopamine: 0.1, stdpActivity: 0.5, titansActivity: 0.4 },
{ loss: 1.0, confidence: 0.8, novelty: 0.2, isSurprise: false, dopamine: 0.6, stdpActivity: 0.7, titansActivity: 0.6 },
];
console.log('【测试感受模块更新】\n');
for (let i = 0; i < testInputs.length; i++) {
const input = testInputs[i];
const state = sentience.update(input);
console.log(`--- 更新 ${i + 1}/${testInputs.length} ---`);
console.log(`输入: loss=${input.loss}, confidence=${input.confidence}, novelty=${input.novelty}`);
console.log(`情绪: ${sentience.getEmotionDescription()}`);
console.log(`感受: ${sentience.getFeelingDescription()}`);
const signals = sentience.getModulationSignals();
console.log(`调制: lr=${signals.lrMultiplier.toFixed(2)}, temp=${signals.temperatureModifier.toFixed(2)}, topK=${signals.topKModifier.toFixed(2)}`);
console.log('');
}
console.log('【序列化测试】');
const serialized = sentience.serialize();
console.log(`已序列化,tick=${serialized.tick}, historyLength=${serialized.historyLength}`);
console.log('');
console.log('【反序列化测试】');
const restored = SentienceModule.deserialize(serialized);
console.log(`已恢复,tick=${restored.getState().tick}`);
console.log(`情绪: ${restored.getEmotionDescription()}`);
console.log('');
console.log('【状态查询测试】');
const state = restored.getState();
console.log(`当前情绪: ${restored.getEmotionDescription()}`);
console.log(`当前感受: ${restored.getFeelingDescription()}`);
console.log(`历史长度: ${restored.getHistory().length}`);
console.log('');
console.log('='.repeat(60));
console.log('✅ 感受模块测试完成');
console.log('='.repeat(60));
|