Instructions to use zero0303/maya2-mlx-dynamic-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use zero0303/maya2-mlx-dynamic-8bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download zero0303/maya2-mlx-dynamic-8bit --local-dir maya2-mlx-dynamic-8bit
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Download maya2_mlx/weights.py from zero0303/maya2-mlx-dynamic-8bit: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/zero0303/maya2-mlx-dynamic-8bit/resolve/main/maya2_mlx/weights.py
- Command line
-
hf download hf://zero0303/maya2-mlx-dynamic-8bit/maya2_mlx/weights.py
-
curl -L -o weights.py https://huggingface.co/zero0303/maya2-mlx-dynamic-8bit/resolve/main/maya2_mlx/weights.py
1.15 kB
| """Load the exported weights (models/maya2, written by export/export_weights.py).""" | |
| import json | |
| import os | |
| import mlx.core as mx | |
| MODELS = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "models") | |
| # the dynamic 8-bit weights (the published model); the 16-bit export (models/maya2, made by export_weights.py) when | |
| # only that one is present | |
| DEFAULT_DIR = next((os.path.join(MODELS, d) for d in ("maya2-8bit", "maya2") if os.path.isdir(os.path.join(MODELS, d))), | |
| os.path.join(MODELS, "maya2-8bit")) | |
| RELEASE_16BIT = os.path.join(MODELS, "maya2") | |
| def load_meta(path=DEFAULT_DIR): | |
| return json.load(open(os.path.join(path, "meta.json"))) | |
| def load(names, path=DEFAULT_DIR): | |
| """Merge the given safetensors files into one dict of mx arrays (dtypes as stored).""" | |
| out = {} | |
| for n in names: | |
| part = mx.load(os.path.join(path, n)) | |
| dup = set(part) & set(out) | |
| if dup: | |
| raise RuntimeError(f"{n}: duplicate tensors {sorted(dup)[:4]}") | |
| out.update(part) | |
| return out | |
| def backbone_files(meta): | |
| return [f for f in meta["files"] if f.startswith("backbone-")] | |