Run this model with HF Jobs
Run Xylolabs/openpilot-Chestnut-MLX on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Xylolabs/openpilot-Chestnut-MLX. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Xylolabs/openpilot-Chestnut-MLX on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Xylolabs/openpilot-Chestnut-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Xylolabs/openpilot-Chestnut-MLX with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download Xylolabs/openpilot-Chestnut-MLX --local-dir openpilot-Chestnut-MLX
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
File size: 1,170 Bytes
59c56e8 7752336 59c56e8 7752336 59c56e8 | 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 | """Run the packaged model on synthetic inputs and reuse its next state."""
import mlx.core as mx
from model import Model
def main():
mx.set_default_device(mx.cpu)
model = Model()
states = model.initial_state()
inputs = {name: mx.zeros(shape, dtype) for name, (shape, dtype) in model.inputs.items()
if name not in states}
if "traffic_convention" in inputs:
shape, dtype = model.inputs["traffic_convention"]
inputs["traffic_convention"] = mx.array([1, 0], dtype=dtype).reshape(shape)
if "action_t" in inputs:
inputs["action_t"] = mx.array([[0.2, 0.3]], dtype=mx.float32)
for _ in range(2 if states else 1):
outputs = model(**inputs, **states)
mx.eval(*outputs.values())
states = {name: outputs[f"next_{name}"] for name in states}
print({name: (value.shape, str(value.dtype)) for name, value in outputs.items()})
for head in model.graph["output_slices"]:
tensor = head.get("tensor", "outputs")
values = outputs[tensor][..., head["start"]:head["stop"]]
print(head["name"], values.shape, values[0, 0].item())
if __name__ == "__main__":
main()
|