Dala.ML.ConfigHelper (dala v0.1.1)

Copy Markdown View Source

Helper to configure ML dependencies and settings for Dala apps.

Usage:

# In your app's mix.exs:
defp deps do
  [
    {:dala, "~> 0.3"},
    {:nx, "~> 0.10"},
    {:axon, "~> 0.8.0"},
    {:scholar, "~> 0.4.0"},
    {:nx_signal, "~> 0.3.0"},
    {:polaris, "~> 0.1"}
    # Optional: Apple Silicon GPU
    {:emlx, github: "elixir-nx/emlx", branch: "main"}
  ]
end

Quantized Models:

# Download pre-trained quantized models:
# - dalaileNetV2: https://huggingface.co/onnx/models/tree/main/vision/classification/dalailenet/model/unknown/1
# - YOLO Nano: https://github.com/ultralytics/yolov5/releases

# Configure in your app:
config = Dala.ML.ConfigHelper.quantized_model_config()
# => %{models: [...], note: "Download from HuggingFace..."}

Summary

Functions

Returns environment variables for iOS builds.

Prints a copy-pasteable config.exs snippet.

Prints a copy-pasteable mix.exs snippet.

Returns quantized model configuration for iOS.

Returns the recommended config for EMLX on iOS.

Returns the recommended deps for ML on Dala.

Functions

build_env_vars()

Returns environment variables for iOS builds.

Add these to your build script or mix.exs make_env.

quantized_model_config()

Returns quantized model configuration for iOS.

Available Models:

  • dalaileNetV2 Quantized: 224x224, 1000 classes, int8, 14MB
  • YOLO Nano Quantized: 416x416, [batch, grid, grid, 3*(5+classes)], int4, 6MB

Download:

Pre-trained models are available from HuggingFace or TensorFlow Hub.