Run this model with HF Jobs
Run Xylolabs/openpilot-driving-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-driving-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-driving-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-driving-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Xylolabs/openpilot-driving-MLX with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download Xylolabs/openpilot-driving-MLX --local-dir openpilot-driving-MLX
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Download cd210/example.py from Xylolabs/openpilot-driving-MLX: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/Xylolabs/openpilot-driving-MLX/resolve/main/cd210/example.py
- Command line
-
hf download hf://Xylolabs/openpilot-driving-MLX/cd210/example.py
-
curl -L -o example.py https://huggingface.co/Xylolabs/openpilot-driving-MLX/resolve/main/cd210/example.py
1.17 kB
| """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() | |