Image-Text-to-Text
Transformers
Safetensors
kimi_k31
text-generation
mixture-of-experts
expert-upcycling
scientific-ai
chip-design
space
physics
s-t-a-r
custom_code
8-bit precision
Instructions to use STAR-future/Trinity with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use STAR-future/Trinity with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="STAR-future/Trinity", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("STAR-future/Trinity", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use STAR-future/Trinity with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "STAR-future/Trinity" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "STAR-future/Trinity", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/STAR-future/Trinity
- SGLang
How to use STAR-future/Trinity 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 "STAR-future/Trinity" \ --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": "STAR-future/Trinity", "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 "STAR-future/Trinity" \ --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": "STAR-future/Trinity", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use STAR-future/Trinity with Docker Model Runner:
docker model run hf.co/STAR-future/Trinity
Download eval/h2a/N1_train_record.json from STAR-future/Trinity: direct link, hf CLI and curl.
- Browser
- Download file 2.13 kB
-
https://huggingface.co/STAR-future/Trinity/resolve/main/eval/h2a/N1_train_record.json
- Command line
-
hf download hf://STAR-future/Trinity/eval/h2a/N1_train_record.json
-
curl -L -o N1_train_record.json https://huggingface.co/STAR-future/Trinity/resolve/main/eval/h2a/N1_train_record.json
2.13 kB
| { | |
| "args": { | |
| "cmd": "train", | |
| "cache": "/content/k3p/out_train", | |
| "out": "/content/k3p/h2a/N1", | |
| "trained": "", | |
| "experts": 16, | |
| "hidden": 1024, | |
| "topk": 2, | |
| "lr": 0.0003, | |
| "epochs": 4.0, | |
| "bs": 2048, | |
| "kl": 1.0, | |
| "val_frac": 0.1, | |
| "seed": 20261119 | |
| }, | |
| "new_expert_parameters": 352436224, | |
| "val_before": 1.8403315544128418, | |
| "val_after": 2.0770204067230225, | |
| "val_gen_before": 0.1100296825170517, | |
| "val_gen_after": 0.11417251825332642, | |
| "rel_dom": 0.12861207087529197, | |
| "rel_gen": 0.037651983005882884, | |
| "delta_W_abs_sum": { | |
| "router": 295.31134033203125, | |
| "gate": 312469.09375, | |
| "up": 320723.53125, | |
| "down": 274400.65625 | |
| }, | |
| "steps": 267, | |
| "log": [ | |
| { | |
| "step": 0, | |
| "loss_domain": 1.8214353322982788, | |
| "loss_kl": 0.0 | |
| }, | |
| { | |
| "step": 20, | |
| "loss_domain": 1.8345516920089722, | |
| "loss_kl": 6.885812035761774e-05 | |
| }, | |
| { | |
| "step": 40, | |
| "loss_domain": 1.8004660606384277, | |
| "loss_kl": 0.0002608851355034858 | |
| }, | |
| { | |
| "step": 60, | |
| "loss_domain": 1.7282191514968872, | |
| "loss_kl": 0.0002983427548315376 | |
| }, | |
| { | |
| "step": 80, | |
| "loss_domain": 1.6105151176452637, | |
| "loss_kl": 0.0006766102742403746 | |
| }, | |
| { | |
| "step": 100, | |
| "loss_domain": 1.4364731311798096, | |
| "loss_kl": 0.0006663534441031516 | |
| }, | |
| { | |
| "step": 120, | |
| "loss_domain": 1.3394174575805664, | |
| "loss_kl": 0.0006410631467588246 | |
| }, | |
| { | |
| "step": 140, | |
| "loss_domain": 1.248926043510437, | |
| "loss_kl": 0.000897740654181689 | |
| }, | |
| { | |
| "step": 160, | |
| "loss_domain": 1.137998342514038, | |
| "loss_kl": 0.001065670745447278 | |
| }, | |
| { | |
| "step": 180, | |
| "loss_domain": 1.0607072114944458, | |
| "loss_kl": 0.0014508693711832166 | |
| }, | |
| { | |
| "step": 200, | |
| "loss_domain": 0.941565752029419, | |
| "loss_kl": 0.0008530134800821543 | |
| }, | |
| { | |
| "step": 220, | |
| "loss_domain": 0.9651099443435669, | |
| "loss_kl": 0.0013245841255411506 | |
| }, | |
| { | |
| "step": 240, | |
| "loss_domain": 0.886405348777771, | |
| "loss_kl": 0.0013737442204728723 | |
| }, | |
| { | |
| "step": 260, | |
| "loss_domain": 0.933637797832489, | |
| "loss_kl": 0.0012137051671743393 | |
| }, | |
| { | |
| "step": 266, | |
| "loss_domain": 0.9157818555831909, | |
| "loss_kl": 0.001604795572347939 | |
| } | |
| ] | |
| } |