Examples in the MLX framework
mlx
Go to file
dmdaksh 7d7e236061
- Removed unused Python imports (#683)
- bert/model.py:10: tree_unflatten
  - bert/model.py:2: dataclass
  - bert/model.py:8: numpy
  - cifar/resnet.py:6: Any
  - clip/model.py:15: tree_flatten
  - clip/model.py:9: Union
  - gcn/main.py:8: download_cora
  - gcn/main.py:9: cross_entropy
  - llms/gguf_llm/models.py:12: tree_flatten, tree_unflatten
  - llms/gguf_llm/models.py:9: numpy
  - llms/mixtral/mixtral.py:12: tree_map
  - llms/mlx_lm/models/dbrx.py:2: Dict, Union
  - llms/mlx_lm/tuner/trainer.py:5: partial
  - llms/speculative_decoding/decoder.py:1: dataclass, field
  - llms/speculative_decoding/decoder.py:2: Optional
  - llms/speculative_decoding/decoder.py:5: mlx.nn
  - llms/speculative_decoding/decoder.py:6: numpy
  - llms/speculative_decoding/main.py:2: glob
  - llms/speculative_decoding/main.py:3: json
  - llms/speculative_decoding/main.py:5: Path
  - llms/speculative_decoding/main.py:8: mlx.nn
  - llms/speculative_decoding/model.py:6: tree_unflatten
  - llms/speculative_decoding/model.py:7: AutoTokenizer
  - llms/tests/test_lora.py:13: yaml_loader
  - lora/lora.py:14: tree_unflatten
  - lora/models.py:11: numpy
  - lora/models.py:3: glob
  - speechcommands/kwt.py:1: Any
  - speechcommands/main.py:7: mlx.data
  - stable_diffusion/stable_diffusion/model_io.py:4: partial
  - whisper/benchmark.py:5: sys
  - whisper/test.py:5: subprocess
  - whisper/whisper/audio.py:6: Optional
  - whisper/whisper/decoding.py:8: mlx.nn
2024-04-16 07:50:32 -07:00
.circleci LoRA on all linear transformer block layers (#546) 2024-03-12 07:37:40 -07:00
bert - Removed unused Python imports (#683) 2024-04-16 07:50:32 -07:00
cifar - Removed unused Python imports (#683) 2024-04-16 07:50:32 -07:00
clip - Removed unused Python imports (#683) 2024-04-16 07:50:32 -07:00
cvae Update a few examples to use compile (#420) 2024-02-08 13:00:41 -08:00
gcn - Removed unused Python imports (#683) 2024-04-16 07:50:32 -07:00
llava Switch to fast RMS/LN Norm (#603) 2024-03-23 07:13:51 -07:00
llms - Removed unused Python imports (#683) 2024-04-16 07:50:32 -07:00
lora - Removed unused Python imports (#683) 2024-04-16 07:50:32 -07:00
mnist Update a few examples to use compile (#420) 2024-02-08 13:00:41 -08:00
normalizing_flow Update a few examples to use compile (#420) 2024-02-08 13:00:41 -08:00
speechcommands - Removed unused Python imports (#683) 2024-04-16 07:50:32 -07:00
stable_diffusion - Removed unused Python imports (#683) 2024-04-16 07:50:32 -07:00
t5 Switch to fast RMS/LN Norm (#603) 2024-03-23 07:13:51 -07:00
transformer_lm Typo: SGD->AdamW (#471) 2024-02-20 15:47:17 -08:00
whisper - Removed unused Python imports (#683) 2024-04-16 07:50:32 -07:00
.gitignore Align CLI args and some smaller fixes (#167) 2023-12-22 14:34:32 -08:00
.pre-commit-config.yaml feat: Update black-pre-commit-mirror to version 24.3.0 (#675) 2024-04-11 07:28:26 -07:00
ACKNOWLEDGMENTS.md Refactoring of mlx_lm example (#501) 2024-03-06 06:24:31 -08:00
CODE_OF_CONDUCT.md contribution + code of conduct 2023-11-29 12:31:18 -08:00
CONTRIBUTING.md feat: add update_config functionality (#531) 2024-03-14 06:36:05 -07:00
LICENSE consistent copyright 2023-11-30 11:11:04 -08:00
README.md LlaVA in MLX (#461) 2024-03-01 10:28:35 -08:00

MLX Examples

This repo contains a variety of standalone examples using the MLX framework.

The MNIST example is a good starting point to learn how to use MLX.

Some more useful examples are listed below.

Text Models

Image Models

Audio Models

Multimodal models

  • Joint text and image embeddings with CLIP.
  • Text generation from image and text inputs with LLaVA.

Other Models

  • Semi-supervised learning on graph-structured data with GCN.
  • Real NVP normalizing flow for density estimation and sampling.

Hugging Face

Note: You can now directly download a few converted checkpoints from the MLX Community organization on Hugging Face. We encourage you to join the community and contribute new models.

Contributing

We are grateful for all of our contributors. If you contribute to MLX Examples and wish to be acknowledged, please add your name to the list in your pull request.

Citing MLX Examples

The MLX software suite was initially developed with equal contribution by Awni Hannun, Jagrit Digani, Angelos Katharopoulos, and Ronan Collobert. If you find MLX Examples useful in your research and wish to cite it, please use the following BibTex entry:

@software{mlx2023,
  author = {Awni Hannun and Jagrit Digani and Angelos Katharopoulos and Ronan Collobert},
  title = {{MLX}: Efficient and flexible machine learning on Apple silicon},
  url = {https://github.com/ml-explore},
  version = {0.0},
  year = {2023},
}