{"id":20710,"date":"2026-05-06T10:38:06","date_gmt":"2026-05-06T02:38:06","guid":{"rendered":"https:\/\/92it.top\/?p=20710"},"modified":"2026-05-06T10:38:06","modified_gmt":"2026-05-06T02:38:06","slug":"%e5%9c%a8-mac-%e4%b8%8a%e5%be%ae%e8%b0%83%e4%b8%80%e5%88%87%e5%a4%a7%e6%a8%a1%e5%9e%8b","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=20710","title":{"rendered":"\u5728 Mac \u4e0a\u5fae\u8c03\u4e00\u5207\u5927\u6a21\u578b"},"content":{"rendered":"\n<p>\u8f6c\u8f7d\uff1a<a href=\"https:\/\/cloud.tencent.com\/developer\/article\/2656409\">\u5728 Mac \u4e0a\u5fae\u8c03\u4e00\u5207\u5927\u6a21\u578b<\/a><\/p>\n\n\n\n<p><strong>\u524d\u8a00 \ud83d\udd16<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u804a\u4e2a\u8ba9\u6211\u975e\u5e38\u5174\u594b\u7684\u9879\u76ee\u2014\u2014<strong>mlx-tune<\/strong><\/p>\n\n\n\n<p>\u4e00\u53e5\u8bdd\u6982\u62ec\uff1a<strong>\u5728\u4f60\u7684 Mac \u4e0a\uff0c\u7528 Unsloth \u7684 <\/strong><strong>API<\/strong><strong> \u5fae\u8c03\u4e00\u5207<\/strong><\/p>\n\n\n\n<p>LLM\u3001\u89c6\u89c9\u6a21\u578b\u3001TTS\u3001STT\u3001OCR\u3001Embedding\uff0c\u5168\u90fd\u80fd\u5728 Apple Silicon \u4e0a\u672c\u5730\u5fae\u8c03<\/p>\n\n\n\n<p><strong>\ud83d\udd39Mac \u7528\u6237\u7684\u5fae\u8c03\u56f0\u5883<\/strong><\/p>\n\n\n\n<p>\u505a\u5927\u6a21\u578b\u5fae\u8c03\u7684\u540c\u5b66\u5e94\u8be5\u90fd\u6709\u8fc7\u8fd9\u79cd\u4f53\u9a8c\uff1a\u60f3\u5728\u672c\u5730\u8dd1\u4e2a\u5c0f\u5b9e\u9a8c\u9a8c\u8bc1\u4e0b idea\uff0c\u7ed3\u679c\u53d1\u73b0 Unsloth \u4f9d\u8d56 Triton\uff0c\u800c Triton \u4e0d\u652f\u6301 Mac<\/p>\n\n\n\n<p>\u4e8e\u662f\u4f60\u53ea\u5269\u4e24\u6761\u8def\uff1a<\/p>\n\n\n\n<ol>\n<li>1. \u82b1\u94b1\u5f00\u4e91 GPU \u2014\u2014 \u5c31\u8dd1\u4e2a 100 \u6761\u6570\u636e\u7684\u5b9e\u9a8c\uff0c\u6709\u5fc5\u8981\u5417\uff1f<\/li>\n\n\n\n<li>2. \u7528 mlx-lm \u539f\u751f API \u2014\u2014 \u4f46\u4ee3\u7801\u548c unsloth \u5b8c\u5168\u4e0d\u517c\u5bb9\uff0c\u5230\u4e86\u4e91\u4e0a\u8fd8\u5f97\u91cd\u5199\u4e00\u904d<\/li>\n<\/ol>\n\n\n\n<p>mlx-tune\uff08github.com\/ARahim3\/mlx-tune\uff09\u7684\u4f5c\u8005\u4e5f\u9047\u5230\u4e86\u4e00\u6a21\u4e00\u6837\u7684\u95ee\u9898<\/p>\n\n\n\n<p>\u4ed6\u7684\u89e3\u51b3\u601d\u8def\u975e\u5e38\u7b80\u5355\u7c97\u66b4\uff1a<strong>\u628a MLX \u5305\u88c5\u6210 Unsloth \u7684 API<\/strong><\/p>\n\n\n\n<p>\u4f60\u5728 Mac \u4e0a\u5199\u7684\u8bad\u7ec3\u811a\u672c\uff0c\u6362\u4e2a import \u5c31\u80fd\u76f4\u63a5\u5728 CUDA \u96c6\u7fa4\u8dd1<\/p>\n\n\n\n<p>mlx-tune \u662f\u4e00\u4e2a\u4e13\u4e3a Apple Silicon \u8bbe\u8ba1\u7684\u673a\u5668\u5b66\u4e60\u5fae\u8c03\u9879\u76ee\u3002\u9488\u5bf9 Mac \u7528\u6237\u96be\u4ee5\u4f7f\u7528\u4f9d\u8d56 Triton \u7684 Unsloth \u5e93\u7684\u95ee\u9898\uff0c\u8be5\u9879\u76ee\u901a\u8fc7\u5c06 MLX \u6846\u67b6\u5c01\u88c5\u4e3a Unsloth \u7684 API \u63a5\u53e3\uff0c\u5b9e\u73b0\u4e86\u4ee3\u7801\u5728\u672c\u5730 Mac \u4e0e\u4e91\u7aef CUDA \u96c6\u7fa4\u95f4\u7684\u65e0\u7f1d\u5207\u6362\u3002\u8fd9\u4e00\u8bbe\u8ba1\u8ba9\u5f00\u53d1\u8005\u80fd\u591f\u5728\u672c\u5730\u8fdb\u884c\u60f3\u6cd5\u9a8c\u8bc1\uff0c\u5e76\u5728\u4e91\u7aef\u76f4\u63a5\u8fd0\u884c\u751f\u4ea7\u7ea7\u4ee3\u7801\uff0c\u65e0\u9700\u4fee\u6539\u6838\u5fc3\u903b\u8f91\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Unsloth (CUDA)                        # MLX-Tune (Apple Silicon)\nfrom unsloth import FastLanguageModel   from mlx_tune import FastLanguageModel\nfrom trl import SFTTrainer              from mlx_tune import SFTTrainer\n\n# \u540e\u9762\u7684\u4ee3\u7801\u4e00\u6a21\u4e00\u6837\uff01\n<\/pre>\n\n\n\n<p>\u8fd9\u624d\u662f\u771f\u6b63\u89e3\u51b3\u95ee\u9898\u7684\u8bbe\u8ba1<\/p>\n\n\n\n<p>\u4e0b\u9762\u8fd9\u5f20\u56fe\u6e05\u695a\u5c55\u793a\u4e86 mlx-tune \u7684\u5de5\u4f5c\u6d41\u2014\u2014\u672c\u5730\u539f\u578b\u9a8c\u8bc1\uff0c\u6539\u4e2a import \u5c31\u80fd\u4e0a\u4e91\u8bad\u7ec3\uff1a<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"980\" height=\"1024\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-14-980x1024.png\" alt=\"\" class=\"wp-image-20711\" style=\"width:500px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-14-980x1024.png 980w, https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-14-287x300.png 287w, https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-14-768x803.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-14-830x868.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-14-230x240.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-14-350x366.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-14-480x502.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-14.png 1102w\" sizes=\"(max-width: 980px) 100vw, 980px\" \/><\/figure><\/div>\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\ud83d\udd39\u6838\u5fc3\u673a\u5236\u4e0e\u4f18\u52bf<\/strong><\/p>\n\n\n\n<p>mlx-tune \u7684\u6838\u5fc3\u4ef7\u503c\u5728\u4e8e\u5176 API \u517c\u5bb9\u6027\u3002\u901a\u8fc7\u6a21\u62df Unsloth \u7684\u63a5\u53e3\uff0c\u7528\u6237\u53ea\u9700\u5c06\u4ee3\u7801\u4e2d\u7684\u5bfc\u5165\u8bed\u53e5\u4ece from unsloth \u4fee\u6539\u4e3a from mlx_tune\uff0c\u5373\u53ef\u5c06\u8bad\u7ec3\u811a\u672c\u8fc1\u79fb\u81f3 Mac \u73af\u5883\u8fd0\u884c\u3002\u8fd9\u4e00\u673a\u5236\u4e0d\u4ec5\u964d\u4f4e\u4e86\u591a\u5e73\u53f0\u5f00\u53d1\u7684\u6210\u672c\uff0c\u4e5f\u586b\u8865\u4e86 Mac \u7aef\u7f3a\u4e4f\u9ad8\u6548\u5fae\u8c03\u5de5\u5177\u7684\u7a7a\u767d\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>\u7279\u6027<\/th><th>Unsloth<\/th><th>mlx-tune<\/th><\/tr><\/thead><tbody><tr><td>\u8fd0\u884c\u73af\u5883<\/td><td>CUDA (Linux\/\u4e91\u7aef)<\/td><td>Apple Silicon (Mac \u672c\u5730)<\/td><\/tr><tr><td>\u4f9d\u8d56\u5e93<\/td><td>Triton<\/td><td>MLX<\/td><\/tr><tr><td>API \u63a5\u53e3<\/td><td>\u539f\u751f\u63a5\u53e3<\/td><td>\u517c\u5bb9 Unsloth API<\/td><\/tr><tr><td>\u786c\u4ef6\u6210\u672c<\/td><td>\u9700\u8d2d\u4e70\u4e91 GPU<\/td><td>\u5229\u7528\u73b0\u6709 Mac \u8bbe\u5907<\/td><\/tr><tr><td>\u4e3b\u8981\u7528\u9014<\/td><td>\u5927\u89c4\u6a21\u751f\u4ea7\u8bad\u7ec3<\/td><td>\u5feb\u901f\u9a8c\u8bc1\u3001\u5c0f\u6570\u636e\u96c6\u5b9e\u9a8c<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\u5168\u6a21\u6001\u529f\u80fd\u652f\u6301\ud83d\udd16<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>\u529f\u80fd\u6709\u591a\u5168\uff1f\u770b\u5b8c\u5413\u4e00\u8df3<\/strong><\/p>\n\n\n\n<p>\u5b83\u652f\u6301\u7684\u8bad\u7ec3\u65b9\u6cd5\u6bd4\u5f88\u591a\u6b63\u7ecf\u516c\u53f8\u7684\u5185\u90e8\u5de5\u5177\u90fd\u5168\uff1a<\/p>\n\n\n\n<p><strong>\u8bed\u8a00\u6a21\u578b\u8bad\u7ec3\uff1a<\/strong><\/p>\n\n\n\n<ul>\n<li><strong>SFT<\/strong>\uff1a\u57fa\u7840\u6307\u4ee4\u5fae\u8c03\uff0c\u8fd9\u662f\u6700\u5e38\u7528\u7684<\/li>\n\n\n\n<li><strong>DPO \/ ORPO \/ KTO \/ SimPO<\/strong>\uff1a\u5404\u79cd\u504f\u597d\u5b66\u4e60\u65b9\u6cd5\u5168\u8986\u76d6<\/li>\n\n\n\n<li><strong>GRPO<\/strong>\uff1aDeepSeek R1 \u98ce\u683c\u7684\u591a\u751f\u6210 + \u5956\u52b1\u8bad\u7ec3<\/li>\n\n\n\n<li><strong>CPT<\/strong>\uff1a\u6301\u7eed\u9884\u8bad\u7ec3\uff0c\u652f\u6301\u89e3\u8026\u5b66\u4e60\u7387<\/li>\n<\/ul>\n\n\n\n<p><strong>\u591a\u6a21\u6001\u8bad\u7ec3\uff1a<\/strong><\/p>\n\n\n\n<ul>\n<li><strong>Vision<\/strong>\uff1a\u652f\u6301 Gemma 4\u3001Qwen3.5\u3001PaliGemma\u3001LLaVA\u3001Pixtral \u7b49 VLM \u5fae\u8c03<\/li>\n\n\n\n<li><strong>TTS<\/strong>\uff1aOrpheus\u3001OuteTTS\u3001Spark-TTS\u3001Sesame\/CSM\u3001Qwen3-TTS \u4e94\u4e2a TTS \u6a21\u578b<\/li>\n\n\n\n<li><strong>STT<\/strong>\uff1aWhisper\u3001Moonshine\u3001Qwen3-ASR\u3001NVIDIA Canary\u3001Voxtral \u4e94\u4e2a STT \u6a21\u578b<\/li>\n\n\n\n<li><strong>Embedding<\/strong>\uff1aBERT\u3001ModernBERT\u3001Qwen3-Embedding\u3001Harrier\uff0c\u652f\u6301\u5bf9\u6bd4\u5b66\u4e60<\/li>\n\n\n\n<li><strong>OCR<\/strong>\uff1aDeepSeek-OCR\u3001GLM-OCR\u3001olmOCR\u3001Qwen-VL\uff0c\u5185\u7f6e CER\/WER \u6307\u6807<\/li>\n<\/ul>\n\n\n\n<p><strong>\u8fdb\u9636\u80fd\u529b\uff1a<\/strong><\/p>\n\n\n\n<ul>\n<li><strong>MoE \u5fae\u8c03<\/strong>\uff1a\u652f\u6301 39+ \u79cd MoE \u67b6\u6784\uff0c\u5305\u62ec Qwen3.5-35B\u3001Mixtral\u3001DeepSeek \u7cfb\u5217<\/li>\n\n\n\n<li><strong>Gemma 4 Audio<\/strong>\uff1a12 \u5c42 Conformer \u97f3\u9891\u5854\uff0c\u539f\u751f\u5904\u7406 16kHz \u97f3\u9891<\/li>\n\n\n\n<li><strong>LFM2<\/strong>\uff1aLiquid AI \u7684\u6df7\u5408\u5377\u79ef+GQA \u67b6\u6784<\/li>\n<\/ul>\n\n\n\n<p>\u8bf4\u771f\u7684\uff0c\u4e00\u4e2a\u793e\u533a\u9879\u76ee\u505a\u5230\u8fd9\u4e2a\u7a0b\u5ea6\uff0c\u76f8\u5f53\u79bb\u8c31<\/p>\n\n\n\n<p>\u5168\u666f\u67b6\u6784\u4e00\u89c8\u2014\u2014\u4ece API \u5230\u786c\u4ef6\u7684\u4e94\u5c42\u8bbe\u8ba1\uff1a<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1009\" height=\"1024\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-16-1009x1024.png\" alt=\"\" class=\"wp-image-20713\" style=\"width:554px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-16-1009x1024.png 1009w, https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-16-296x300.png 296w, https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-16-768x779.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-16-830x842.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-16-230x233.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-16-350x355.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-16-480x487.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2026\/05\/\u56fe\u7247-16.png 1100w\" sizes=\"(max-width: 1009px) 100vw, 1009px\" \/><\/figure><\/div>\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong><strong>\u5feb\u901f\u4e0a\u624b<\/strong>\ud83d\udd16<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>\ud83d\udd39\u57fa\u672c\u601d\u8def<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u5b89\u88c5\u73af\u5883<br>  \u901a\u8fc7 pip install mlx-tune \u547d\u4ee4\u5b89\u88c5\u9879\u76ee\u5e93\u3002<br>\u914d\u7f6e\u6a21\u578b<br>  \u52a0\u8f7d\u6a21\u578b\u5e76\u914d\u7f6e LoRA (Low-Rank Adaptation) \u53c2\u6570\u3002<br>\u6267\u884c\u8bad\u7ec3<br>  \u8fd0\u884c\u8bad\u7ec3\u811a\u672c\uff0c\u5728\u672c\u5730\u5b8c\u6210\u5fae\u8c03\u8fc7\u7a0b\u3002<br>\u5bfc\u51fa\u90e8\u7f72<br>  \u5c06\u8bad\u7ec3\u5b8c\u6210\u7684\u6a21\u578b\u76f4\u63a5\u5bfc\u51fa\u4e3a GGUF \u683c\u5f0f\uff0c\u5373\u53ef\u5bfc\u5165 Ollama \u8fdb\u884c\u63a8\u7406\u5e94\u7528\u3002<\/pre>\n\n\n\n<p>\u5b89\u88c5\u5f88\u7b80\u5355\uff0c\u63a8\u8350\u7528 uv\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u6807\u51c6\u5b89\u88c5\nuv pip install mlx-tune\n\n# \u5e26\u97f3\u9891\u652f\u6301\nuv pip install 'mlx-tune'\nbrew install ffmpeg\n<\/pre>\n\n\n\n<p>\u6765\u4e2a\u6700\u57fa\u7840\u7684 SFT \u5fae\u8c03\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from mlx_tune import FastLanguageModel, SFTTrainer, SFTConfig\nfrom datasets import load_dataset\n\n# \u52a0\u8f7d\u6a21\u578b\uff084bit \u91cf\u5316\uff0c\u7701\u663e\u5b58\uff09\nmodel, tokenizer = FastLanguageModel.from_pretrained(\n    model_name=\"mlx-community\/Llama-3.2-1B-Instruct-4bit\",\n    max_seq_length=2048,\n    load_in_4bit=True,\n)\n\n# \u52a0 LoRA\nmodel = FastLanguageModel.get_peft_model(\n    model,\n    r=16,\n    target_modules=[\"q_proj\", \"k_proj\", \"v_proj\", \"o_proj\"],\n    lora_alpha=16,\n)\n\n# \u52a0\u8f7d\u6570\u636e\u96c6\ndataset = load_dataset(\"yahma\/alpaca-cleaned\", split=\"train[:100]\")\n\n# \u8bad\u7ec3\ntrainer = SFTTrainer(\n    model=model,\n    train_dataset=dataset,\n    tokenizer=tokenizer,\n    args=SFTConfig(\n        output_dir=\"outputs\",\n        per_device_train_batch_size=2,\n        learning_rate=2e-4,\n        max_steps=50,\n    ),\n)\ntrainer.train()\n\n# \u4fdd\u5b58\uff1a\u4e09\u79cd\u683c\u5f0f\u968f\u4f60\u9009\nmodel.save_pretrained(\"lora_model\")           # LoRA \u9002\u914d\u5668\nmodel.save_pretrained_merged(\"merged\", tokenizer)  # \u5408\u5e76\u540e\u7684\u5b8c\u6574\u6a21\u578b\nmodel.save_pretrained_gguf(\"model\", tokenizer)     # GGUF \u683c\u5f0f\uff0c\u76f4\u63a5\u7ed9 Ollama \u7528\n<\/pre>\n\n\n\n<p>\u5982\u679c\u4f60\u7528\u8fc7 Unsloth\uff0c\u8fd9\u4ee3\u7801\u770b\u7740\u662f\u4e0d\u662f\u7279\u522b\u773c\u719f\uff1f\u5bf9\uff0c<strong>\u5c31\u662f\u540c\u4e00\u5957 API<\/strong><\/p>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\ud83d\udd39\u89c6\u89c9\u6a21\u578b\u5fae\u8c03<\/strong><\/p>\n\n\n\n<p>VLM \u5fae\u8c03\u4e5f\u662f\u540c\u6837\u7b80\u6d01\u7684\u4f53\u9a8c\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from mlx_tune import FastVisionModel, UnslothVisionDataCollator, VLMSFTTrainer\nfrom mlx_tune.vlm import VLMSFTConfig\n\nmodel, processor = FastVisionModel.from_pretrained(\n\"mlx-community\/Qwen3.5-0.8B-bf16\",\n)\n\nmodel = FastVisionModel.get_peft_model(\n    model,\n    finetune_vision_layers=True,    # \u89c6\u89c9\u5c42\u4e5f\u5fae\u8c03\n    finetune_language_layers=True,\n    r=16, lora_alpha=16,\n)\n\n# \u8bad\u7ec3\uff08\u6570\u636e\u96c6\u683c\u5f0f\u548c Unsloth \u4e00\u81f4\uff09\nFastVisionModel.for_training(model)\ntrainer = VLMSFTTrainer(\n    model=model,\n    tokenizer=processor,\n    data_collator=UnslothVisionDataCollator(model, processor),\n    train_dataset=dataset,\n    args=VLMSFTConfig(max_steps=30, learning_rate=2e-4),\n)\ntrainer.train()\n<\/pre>\n\n\n\n<p>Gemma 4\u3001Qwen3.5\u3001PaliGemma\u3001LLaVA\u3001Pixtral \u90fd\u652f\u6301<\/p>\n\n\n\n<p>\u4f60\u751a\u81f3\u53ef\u4ee5\u7528 Vision GRPO \u6765\u8bad\u7ec3\u89c6\u89c9\u63a8\u7406\u80fd\u529b<\/p>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\ud83d\udd39TTS \u5fae\u8c03\uff1a\u5728 Mac \u4e0a\u514b\u9686\u58f0\u97f3<\/strong><\/p>\n\n\n\n<p>\u8fd9\u4e2a\u529f\u80fd\u6211\u89c9\u5f97\u7279\u522b\u6709\u610f\u601d\u2014\u2014\u5728 Mac \u4e0a\u672c\u5730\u5fae\u8c03 TTS \u6a21\u578b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from mlx_tune import FastTTSModel, TTSSFTTrainer, TTSSFTConfig, TTSDataCollator\nfrom datasets import load_dataset, Audio\n\n# \u81ea\u52a8\u68c0\u6d4b\u6a21\u578b\u7c7b\u578b\u3001\u7f16\u7801\u5668\u548c token \u683c\u5f0f\nmodel, tokenizer = FastTTSModel.from_pretrained(\n\"mlx-community\/orpheus-3b-0.1-ft-bf16\"\n)\nmodel = FastTTSModel.get_peft_model(model, r=16, lora_alpha=16)\n\ndataset = load_dataset(\"MrDragonFox\/Elise\", split=\"train[:100]\")\ndataset = dataset.cast_column(\"audio\", Audio(sampling_rate=24000))\n\ntrainer = TTSSFTTrainer(\n    model=model, tokenizer=tokenizer,\n    data_collator=TTSDataCollator(model, tokenizer),\n    train_dataset=dataset,\n    args=TTSSFTConfig(output_dir=\".\/tts_output\", max_steps=60),\n)\ntrainer.train()\n<\/pre>\n\n\n\n<p>Orpheus\u3001OuteTTS\u3001Spark-TTS\u3001Sesame\/CSM\u3001Qwen3-TTS \u90fd\u652f\u6301<\/p>\n\n\n\n<p>\u60f3\u505a\u58f0\u97f3\u514b\u9686\u6216\u8005\u98ce\u683c\u5316 TTS\uff0c\u518d\u4e5f\u4e0d\u7528\u79df GPU \u4e86<\/p>\n\n\n\n<p>\u3000\u3000<\/p>\n\n\n\n<p><strong>\ud83d\udd39\u5de5\u4f5c\u6d41\u5168\u666f<\/strong><\/p>\n\n\n\n<p>mlx-tune \u7684\u5b9a\u4f4d\u975e\u5e38\u6e05\u6670\uff1a<strong>\u672c\u5730\u539f\u578b \u2192 \u4e91\u7aef\u91cf\u4ea7<\/strong>\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\u672c\u5730 Mac (mlx-tune)              \u4e91\u7aef GPU (Unsloth)\n\u251c\u2500\u2500 \u5feb\u901f\u5b9e\u9a8c                       \u251c\u2500\u2500 \u5927\u89c4\u6a21\u8bad\u7ec3\n\u251c\u2500\u2500 \u5c0f\u6570\u636e\u96c6\u9a8c\u8bc1                    \u251c\u2500\u2500 \u5b8c\u6574\u6570\u636e\u96c6\n\u251c\u2500\u2500 \u79d2\u7ea7\u8fed\u4ee3                       \u251c\u2500\u2500 \u751f\u4ea7\u7ea7\u4f18\u5316\n\u2514\u2500\u2500 \u540c\u4e00\u5957\u4ee3\u7801 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2514\u2500\u2500 \u540c\u4e00\u5957\u4ee3\u7801\n<\/pre>\n\n\n\n<p>\u8bad\u7ec3\u5b8c\u8fd8\u80fd\u76f4\u63a5\u5bfc\u51fa\uff1a<\/p>\n\n\n\n<ul>\n<li><strong>HuggingFace \u683c\u5f0f<\/strong>\uff1a\u6807\u51c6\u4fdd\u5b58<\/li>\n\n\n\n<li><strong>GGUF<\/strong>\uff1a\u76f4\u63a5\u4e22\u7ed9 Ollama \/ llama.cpp<\/li>\n\n\n\n<li><strong>push_to_hub<\/strong>\uff1a\u4e00\u952e\u63a8\u5230 HuggingFace Hub<\/li>\n<\/ul>\n\n\n\n<p><strong>\u5b83\u9002\u5408\u8c01\uff1f<\/strong><\/p>\n\n\n\n<p>\u6211\u89c9\u5f97 mlx-tune \u6700\u9002\u5408\u8fd9\u51e0\u7c7b\u4eba\uff1a<\/p>\n\n\n\n<ol>\n<li>1. <strong>Mac \u7528\u6237 + \u5fae\u8c03\u9700\u6c42<\/strong>\uff1a\u4f60\u6709 M1\/M2\/M3\/M4\/M5\uff0c\u60f3\u5728\u672c\u5730\u8dd1\u5fae\u8c03\u5b9e\u9a8c\uff0c\u8fd9\u662f\u6700\u4f73\u9009\u62e9<\/li>\n\n\n\n<li>2. <strong>\u6df7\u5408\u5de5\u4f5c\u6d41\u7528\u6237<\/strong>\uff1a\u672c\u5730\u8c03\u8bd5\u3001\u4e91\u7aef\u8bad\u7ec3\uff0c\u4ee3\u7801\u65e0\u7f1d\u8fc1\u79fb<\/li>\n\n\n\n<li>3. <strong>\u591a\u6a21\u6001\u63a2\u7d22\u8005<\/strong>\uff1a\u60f3\u540c\u65f6\u73a9 LLM\u3001Vision\u3001TTS\u3001STT\u3001OCR \u5fae\u8c03\u7684\u4eba<\/li>\n\n\n\n<li>4. <strong>\u5b66\u4e60\u8005<\/strong>\uff1a\u60f3\u7406\u89e3\u5fae\u8c03\u539f\u7406\uff0c\u5728\u672c\u5730\u5feb\u901f\u8fed\u4ee3\u6bd4\u53bb Colab \u6392\u961f\u5f3a\u592a\u591a<\/li>\n<\/ol>\n\n\n\n<p><strong>\u5c40\u9650\u6027\u4e5f\u5f97\u8bf4\u6e05\u695a\uff1a<\/strong><\/p>\n\n\n\n<ul>\n<li>\u2022 \u8bad\u7ec3\u901f\u5ea6\u80af\u5b9a\u6bd4\u4e0d\u4e0a A100 + Unsloth\uff0c\u8fd9\u662f\u7269\u7406\u5b9a\u5f8b\u51b3\u5b9a\u7684<\/li>\n\n\n\n<li>\u2022 GGUF \u5bfc\u51fa\u5bf9\u91cf\u5316\u6a21\u578b\u6709\u9650\u5236\uff0c\u5efa\u8bae\u7528\u975e\u91cf\u5316\u57fa\u5ea7\u6a21\u578b<\/li>\n\n\n\n<li>\u2022 \u5185\u5b58\u53d7\u9650\u4e8e Mac \u7684\u7edf\u4e00\u5185\u5b58\uff08\u4e0d\u8fc7 Mac Studio \u6700\u9ad8 512GB\uff0c\u591f\u7528\u4e86\uff09<\/li>\n<\/ul>\n\n\n\n<p>\u5982\u679c\u4f60\u662f Mac \u7528\u6237\uff0c\u53c8\u5bf9\u5fae\u8c03\u5927\u6a21\u578b\u611f\u5174\u8da3\uff0c\u5f3a\u70c8\u5efa\u8bae\u8bd5\u8bd5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6c\u8f7d\uff1a\u5728 Mac \u4e0a\u5fae\u8c03\u4e00\u5207\u5927\u6a21\u578b \u524d\u8a00 \ud83d\udd16 \u804a\u4e2a\u8ba9\u6211\u975e\u5e38\u5174\u594b\u7684\u9879\u76ee\u2014\u2014mlx-tune \u4e00\u53e5\u8bdd\u6982\u62ec\uff1a\u5728\u4f60\u7684  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/20710"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20710"}],"version-history":[{"count":1,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/20710\/revisions"}],"predecessor-version":[{"id":20714,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/20710\/revisions\/20714"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}