Text-to-Image
MLX
Safetensors
English
nemotron_h
apple-silicon
mac
autoregressive
mamba
Mixture of Experts
nemotron
nemotron-labs-image
q5
custom_code
Instructions to use VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit --local-dir Nemotron-Labs-Image-30B-A3B-MLX-5bit
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Download code/scripts/make_seqs.py from VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit: direct link, hf CLI and curl.
- Browser
- Download file 1.5 kB
-
https://huggingface.co/VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit/resolve/main/code/scripts/make_seqs.py
- Command line
-
hf download hf://VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit/code/scripts/make_seqs.py
-
curl -L -o make_seqs.py https://huggingface.co/VisualInference/Nemotron-Labs-Image-30B-A3B-MLX-5bit/resolve/main/code/scripts/make_seqs.py
1.5 kB
| """Build teacher-forcing sequences (prompt ids + generated tokens) for eval_paths.py. | |
| python make_seqs.py --model DIR --cases cases.json --runs RUN_DIR [RUN_DIR ...] --out seqs.json | |
| Each run dir holds <case>_s<seed>.tokens.npy from bench_gen.py. | |
| """ | |
| import argparse, json | |
| from pathlib import Path | |
| import numpy as np | |
| from nemotron_image_mlx.prompt import PromptTokenizer | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--model", required=True) | |
| ap.add_argument("--cases", required=True, nargs="+") | |
| ap.add_argument("--runs", required=True, nargs="+") | |
| ap.add_argument("--out", required=True) | |
| ap.add_argument("--max", type=int, default=999) | |
| args = ap.parse_args() | |
| tok = PromptTokenizer(args.model) | |
| cases = {} | |
| for f in args.cases: | |
| for c in json.loads(Path(f).read_text()): | |
| cases[c["name"]] = c | |
| seqs = [] | |
| for d in args.runs: | |
| for f in sorted(Path(d).glob("*.tokens.npy")): | |
| name = f.name[: -len(".tokens.npy")] | |
| cname, seed = name.rsplit("_s", 1) | |
| c = cases[cname] | |
| pids = tok.encode(c["prompt"], c["w"], c["h"]) | |
| gen = np.load(f).tolist() | |
| if gen[-1] != tok.ids.img_end: | |
| print("skip (no img_end):", name) | |
| continue | |
| seqs.append({"name": f"{Path(d).name}/{name}", "ids": pids + gen, "prompt_len": len(pids), | |
| "seed": int(seed), "w": c["w"], "h": c["h"]}) | |
| seqs = seqs[: args.max] | |
| Path(args.out).write_text(json.dumps(seqs)) | |
| print(len(seqs), "sequences;", sum(len(s["ids"]) for s in seqs), "tokens") | |