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
H6 without train4 when absent
Browse files- tools/colab_k3pass.py +5 -4
tools/colab_k3pass.py
CHANGED
|
@@ -232,9 +232,10 @@ if MODE == "sealed":
|
|
| 232 |
if MODE == "h6":
|
| 233 |
import shutil
|
| 234 |
from huggingface_hub import snapshot_download
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
|
|
|
| 238 |
if (W / "work_train4").exists(): # regenerable work files: free the scratch disk
|
| 239 |
shutil.rmtree((W / "work_train4").resolve(), ignore_errors=True)
|
| 240 |
scratch = Path("/mnt/local-scratch") if Path("/mnt/local-scratch").exists() else W
|
|
@@ -253,7 +254,7 @@ if MODE == "h6":
|
|
| 253 |
h6 = W / "h6"
|
| 254 |
if not (h6 / "full_tail_wsp.pt").exists():
|
| 255 |
rc = run([sys.executable, "-u", str(W / "trinity_full_tail_wsp.py"), "train", "--cache", str(W / "out_train2"),
|
| 256 |
-
str(W / "out_train3"),
|
| 257 |
"--head-rank", "256", "--head-alpha", "256", "--tail-rank", "128", "--tail-alpha", "128",
|
| 258 |
"--k", "128", "--routed-rank", "16", "--routed-alpha", "16", "--lr", "1.5e-4", "--epochs", "3.0",
|
| 259 |
"--kl", "6.0", "--block-size", "256"], "h6_train.log")
|
|
|
|
| 232 |
if MODE == "h6":
|
| 233 |
import shutil
|
| 234 |
from huggingface_hub import snapshot_download
|
| 235 |
+
if not (W / "out_sealed" / "summary.json").exists():
|
| 236 |
+
raise SystemExit("H6 needs out_sealed on this VM (run K3P=sealed first)")
|
| 237 |
+
extra = [str(W / "out_train4")] if (W / "out_train4" / "summary.json").exists() else [] # train4 if this VM built it
|
| 238 |
+
print("H6 caches: train2, train3" + (", train4" if extra else ""), flush=True)
|
| 239 |
if (W / "work_train4").exists(): # regenerable work files: free the scratch disk
|
| 240 |
shutil.rmtree((W / "work_train4").resolve(), ignore_errors=True)
|
| 241 |
scratch = Path("/mnt/local-scratch") if Path("/mnt/local-scratch").exists() else W
|
|
|
|
| 254 |
h6 = W / "h6"
|
| 255 |
if not (h6 / "full_tail_wsp.pt").exists():
|
| 256 |
rc = run([sys.executable, "-u", str(W / "trinity_full_tail_wsp.py"), "train", "--cache", str(W / "out_train2"),
|
| 257 |
+
str(W / "out_train3"), *extra, "--out", str(h6), "--domains", "chips,space",
|
| 258 |
"--head-rank", "256", "--head-alpha", "256", "--tail-rank", "128", "--tail-alpha", "128",
|
| 259 |
"--k", "128", "--routed-rank", "16", "--routed-alpha", "16", "--lr", "1.5e-4", "--epochs", "3.0",
|
| 260 |
"--kl", "6.0", "--block-size", "256"], "h6_train.log")
|