Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Formula/m/mlx-c.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class MlxC < Formula
url "https://github.com/ml-explore/mlx-c/archive/refs/tags/v0.4.1.tar.gz"
sha256 "e22b51b810b9c3bdce8c0df0d6112ca8e8a49ce0ea78b504e1bdbb59d731f5d8"
license "MIT"
revision 1

bottle do
sha256 cellar: :any, arm64_tahoe: "252a76effb17e213664f0cddb0b0c28496fa1bdad146ef806416ada91f84e584"
Expand All @@ -17,6 +18,16 @@ class MlxC < Formula
depends_on "mlx"

def install
# Upstream: MLX Metal device_info is implemented via the GPU backend.
# https://github.com/ml-explore/mlx/blob/v0.30.5/mlx/backend/metal/device_info.cpp
# upstream pr ref, https://github.com/ml-explore/mlx-c/pull/99
inreplace "mlx/c/metal.cpp",
"#include \"mlx/c/metal.h\"\n",
"#include \"mlx/c/metal.h\"\n#include \"mlx/backend/gpu/device_info.h\"\n"
inreplace "mlx/c/metal.cpp",
"mlx::core::metal::device_info()",
"mlx::core::gpu::device_info(0)"

args = %w[
-DBUILD_SHARED_LIBS=ON
-DMLX_C_BUILD_EXAMPLES=OFF
Expand Down
32 changes: 8 additions & 24 deletions Formula/m/mlx-lm.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
class MlxLm < Formula
include Language::Python::Virtualenv

desc "Run LLMs with MLX"
homepage "https://github.com/ml-explore/mlx-lm"
url "https://github.com/ml-explore/mlx-lm/archive/refs/tags/v0.30.5.tar.gz"
sha256 "9f290ceaf9591f6212983262ef1217426b8861249a4901cb7b43aa72c136fa36"
url "https://github.com/ml-explore/mlx-lm/archive/refs/tags/v0.30.6.tar.gz"
sha256 "6913626489b648001813687cb7d49858cef52eed4a0e06788863ebd23881d1cd"
license "MIT"
revision 1
head "https://github.com/ml-explore/mlx-lm.git", branch: "main"

bottle do
Expand Down Expand Up @@ -34,11 +33,6 @@
sha256 "41cfcc3a4c85d3f05c932da7c26d0201ac36f72abd4435ba90d0464a3ffed703"
end

resource "charset-normalizer" do
url "https://files.pythonhosted.org/packages/13/69/33ddede1939fdd074bce5434295f38fae7136463422fe4fd3e0e89b98062/charset_normalizer-3.4.4.tar.gz"
sha256 "94537985111c35f28720e43603b8e7b43a6ecfb2ce1d3058bbe955b73404e21a"
end

resource "click" do
url "https://files.pythonhosted.org/packages/3d/fa/656b739db8587d7b5dfa22e22ed02566950fbfbcdc20311993483657a5c0/click-8.3.1.tar.gz"
sha256 "12ff4785d337a1bb490bb7e9c2b1ee5da3112e94a8622f26a6c77f5d2fc6842a"
Expand Down Expand Up @@ -75,8 +69,8 @@
end

resource "huggingface-hub" do
url "https://files.pythonhosted.org/packages/67/e9/2658cb9bc4c72a67b7f87650e827266139befaf499095883d30dabc4d49f/huggingface_hub-1.3.5.tar.gz"
sha256 "8045aca8ddab35d937138f3c386c6d43a275f53437c5c64cdc9aa8408653b4ed"
url "https://files.pythonhosted.org/packages/d9/0e/e73927175162b8a4702b9f59268860f441fbe037c3960b1b6791eeb1deb7/huggingface_hub-1.4.0.tar.gz"
sha256 "dd8ca29409be10f544b624265f7ffe13a1a5c3f049f493b5dc9816ef3c6bd57b"
end

resource "idna" do
Expand Down Expand Up @@ -114,11 +108,6 @@
sha256 "164759aa25575cbc0651bef59a0b18353e54300d79ace8084c818ad8ac72b7d5"
end

resource "requests" do
url "https://files.pythonhosted.org/packages/c9/74/b3ff8e6c8446842c3f5c837e9c3dfcfe2018ea6ecef224c710c85ef728f4/requests-2.32.5.tar.gz"
sha256 "dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf"
end

resource "safetensors" do
url "https://files.pythonhosted.org/packages/29/9c/6e74567782559a63bd040a236edca26fd71bc7ba88de2ef35d75df3bca5e/safetensors-0.7.0.tar.gz"
sha256 "07663963b67e8bd9f0b8ad15bb9163606cd27cc5a1b96235a50d8369803b96b0"
Expand All @@ -140,13 +129,13 @@
end

resource "tqdm" do
url "https://files.pythonhosted.org/packages/a8/4b/29b4ef32e036bb34e4ab51796dd745cdba7ed47ad142a9f4a1eb8e0c744d/tqdm-4.67.1.tar.gz"
sha256 "f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2"
url "https://files.pythonhosted.org/packages/09/a9/6ba95a270c6f1fbcd8dac228323f2777d886cb206987444e4bce66338dd4/tqdm-4.67.3.tar.gz"
sha256 "7d825f03f89244ef73f1d4ce193cb1774a8179fd96f31d7e1dcde62092b960bb"
end

resource "transformers" do
url "https://files.pythonhosted.org/packages/3f/a3/7c116a8d85f69ea7749cf4c2df79e64c35d028e5fc7ea0168f299d03b8c7/transformers-5.0.0rc3.tar.gz"
sha256 "a0315b92b7e087617ade42ec9e6e92ee7620541cc5d6a3331886c52cbe306f5c"
url "https://files.pythonhosted.org/packages/bc/79/845941711811789c85fb7e2599cea425a14a07eda40f50896b9d3fda7492/transformers-5.0.0.tar.gz"
sha256 "5f5634efed6cf76ad068cc5834c7adbc32db78bbd6211fb70df2325a9c37dec8"
end

resource "typer-slim" do
Expand All @@ -159,11 +148,6 @@
sha256 "0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466"
end

resource "urllib3" do
url "https://files.pythonhosted.org/packages/c7/24/5f1b3bdffd70275f6661c76461e25f024d5a38a46f04aaca912426a2b1d3/urllib3-2.6.3.tar.gz"
sha256 "1b62b6884944a57dbe321509ab94fd4d3b307075e0c2eae991ac71ee15ad38ed"
end

def install
virtualenv_install_with_resources
end
Expand Down
5 changes: 3 additions & 2 deletions Formula/m/mlx.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
class Mlx < Formula
include Language::Python::Virtualenv

desc "Array framework for Apple silicon"
homepage "https://github.com/ml-explore/mlx"
url "https://github.com/ml-explore/mlx/archive/refs/tags/v0.30.3.tar.gz"
sha256 "c08092f4e3e853cb99ae97426d90e9bd003379c4d3e6f17aca5b7af9d0a4fed9"
url "https://github.com/ml-explore/mlx/archive/refs/tags/v0.30.5.tar.gz"
sha256 "448eefb3c9d4f42001e7e3236b2a33326a892dee520aaf4da60c2fa5c11182e2"
license all_of: [
"MIT", # main license
"Apache-2.0", # metal-cpp resource
]
compatibility_version 1
head "https://github.com/ml-explore/mlx.git", branch: "main"

bottle do
Expand Down
Loading