From 8bd81217137c499e56331a64ee19f106bc3ae390 Mon Sep 17 00:00:00 2001 From: Awni Hannun Date: Mon, 25 Aug 2025 09:30:08 -0700 Subject: [PATCH] switch quantized and non-quantized to be correct --- ...age_models_on_Apple_silicon_with_MLX.ipynb | 436 ++---------------- 1 file changed, 36 insertions(+), 400 deletions(-) diff --git a/wwdc25/Explore_language_models_on_Apple_silicon_with_MLX.ipynb b/wwdc25/Explore_language_models_on_Apple_silicon_with_MLX.ipynb index 871de0d0..776a60e5 100644 --- a/wwdc25/Explore_language_models_on_Apple_silicon_with_MLX.ipynb +++ b/wwdc25/Explore_language_models_on_Apple_silicon_with_MLX.ipynb @@ -10,7 +10,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "a9f4b67f", "metadata": {}, "outputs": [], @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "5a45bf5a", "metadata": {}, "outputs": [], @@ -58,30 +58,10 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "51bd2ed4", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Fetching 7 files: 100%|███████████████████████| 7/7 [00:00<00:00, 120328.39it/s]\n", - "==========\n", - "Here's a simple implementation of the QuickSort algorithm in Swift. This version uses Swift's built-in `swapAt()` function to swap elements in an array.\n", - "\n", - "```swift\n", - "func quickSort(_ array: inout [Int], _ low: Int, _ high: Int) {\n", - " if low < high {\n", - " let pivotIndex = partition(array, low, high)\n", - " quickSort(&array, low, pivot\n", - "==========\n", - "Prompt: 12 tokens, 78.111 tokens-per-sec\n", - "Generation: 100 tokens, 32.263 tokens-per-sec\n", - "Peak memory: 4.138 GB\n" - ] - } - ], + "outputs": [], "source": [ "!mlx_lm.generate --model \"mlx-community/Mistral-7B-Instruct-v0.3-4bit\" \\\n", " --prompt \"Write a quick sort in Swift\"" @@ -97,60 +77,10 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "f7add212", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Fetching 7 files: 100%|███████████████████████| 7/7 [00:00<00:00, 100205.22it/s]\n", - "==========\n", - "Here's a simple implementation of the QuickSort algorithm in Swift. This version uses Swift's built-in `swapAt()` function to swap elements in an array.\n", - "\n", - "```swift\n", - "func quickSort(_ array: inout [Int], _ low: Int, _ high: Int) {\n", - " if low < high {\n", - " let pivotIndex = partition(array, low, high)\n", - " quickSort(&array, low, pivotIndex - 1)\n", - " quickSort(&array, pivotIndex + 1, high)\n", - " }\n", - "}\n", - "\n", - "func partition(_ array: inout [Int], _ low: Int, _ high: Int) -> Int {\n", - " let pivot = array[high]\n", - " var i = low\n", - " for j in low.. Int {\n", - " let pivot = array[high]\n", - " var i = low\n", - " for j in low.. Int {\n", - " let pivot = array[high]\n", - " var i = low\n", - " for j in low..