{"id":1626,"date":"2024-07-22T23:08:41","date_gmt":"2024-07-22T14:08:41","guid":{"rendered":"https:\/\/blog.peddals.com\/?p=1626"},"modified":"2024-07-22T23:08:42","modified_gmt":"2024-07-22T14:08:42","slug":"apple-mps-to-generate-audio-with-meta-audiogen","status":"publish","type":"post","link":"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/","title":{"rendered":"Run Meta&#8217;s Audio Generation AI model, AudioGen, on macOS with MPS (GPU)"},"content":{"rendered":"\n<p>Meta, the company behind Facebook, released AudioCraft \u2013 an AI capable of generating music and sound effects from English text. The initial version, v0.0.1, dropped in June 2023, followed by few revisions and the latest (as of now writing this) v1.3.0 in May 2024. The best part? You can run it locally for free!<\/p>\n\n\n\n<p>However, there&#8217;s a catch: official support is limited to NVIDIA GPUs or CPUs. macOS users are stuck with CPU-only execution. Frustrating, right?<\/p>\n\n\n\n<p>After much research and experimentation, I discovered a way to speed up the generation process for AudioGen, AudioCraft&#8217;s sound effects generator, by leveraging Apple Silicon&#8217;s GPU \u2013 MPS (Metal Performance Shaders)!<\/p>\n\n\n\n<p>In this article, I&#8217;ll share my findings and guide you through the steps to unlock faster audio generation on your Mac.<\/p>\n\n\n\n<p>AudioCraft: <a href=\"https:\/\/ai.meta.com\/resources\/models-and-libraries\/audiocraft\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/ai.meta.com\/resources\/models-and-libraries\/audiocraft<\/a><\/p>\n\n\n\n<p>GitHub: <a href=\"https:\/\/github.com\/facebookresearch\/audiocraft\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/facebookresearch\/audiocraft<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Notes<\/h2>\n\n\n\n<p>While AudioCraft&#8217;s code is released under the permissive MIT license, it&#8217;s important to note that the model weights (the pre-trained files downloaded from Hugging Face) are distributed under the <a href=\"https:\/\/creativecommons.org\/licenses\/by-nc\/4.0\/deed.en\" target=\"_blank\" rel=\"noreferrer noopener\">CC-BY-NC 4.0<\/a> license, which prohibits commercial use. Therefore, be mindful of this restriction if you plan to publicly share any audio generated using AudioCraft.<\/p>\n\n\n\n<p>AudioCraft also includes MusicGen, a model for generating music, as well as MAGNeT, a newer, faster, and supposedly higher-performing model. Unfortunately,<br>I wasn&#8217;t able to get these models running with MPS.<\/p>\n\n\n\n<p>While development isn&#8217;t stagnant, there are a few open issues on GitHub, hinting at possible future official support. However, even though you can run AudioCraft locally for free, unlike platforms like Stable Audio which offer commercial licenses for a fee, it seems unlikely that any external forces besides the passionate efforts of open-source programmers will drive significant progress. So, let&#8217;s manage our expectations!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Environment Setup<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Confirmed Working Environment<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\"><code>macOS: 14.5\nffmpeg version 7.0.1<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Setup Procedure<\/h3>\n\n\n\n<p>Install ffmpeg if not installed yet. You need brew installed.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\" data-show-lang=\"1\"><code>brew install ffmpeg<\/code><\/pre><\/div>\n\n\n\n<p>Create a directory and clone the AudioCraft repository. Choose your preferred directory name.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\"><code>mkdir AudioCraft_MPS\ncd AudioCraft_MPS\ngit clone https:\/\/github.com\/facebookresearch\/audiocraft.git .<\/code><\/pre><\/div>\n\n\n\n<p>Set up a virtual environment. I prefer <code>pipenv<\/code>, but feel free to use your favorite. <span style=\"text-decoration: underline;\">Python 3.9 or above<\/span> is required.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\"><code>pipenv --python 3.11\npipenv shell<\/code><\/pre><\/div>\n\n\n\n<p>Install PyToch with a specific version 2.1.0.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\"><code>pip install torch==2.1.0<\/code><\/pre><\/div>\n\n\n\n<p>Set xformer&#8217;s version to <code>0.0.20<\/code> in <code>requirements.txt<\/code>. MPS doesn&#8217;t support xformers, but this was the easiest workaround. The example below uses <code>vim<\/code>, but feel free to use your preferred text editor.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\"><code>vi requirements.txt\n#xformer&lt;0.0.23\nxformers==0.0.20<\/code><\/pre><\/div>\n\n\n\n<p>Install everything, and the environment is set up!<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\"><code>pip install -e .<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Edit one file to use MPS for generation.<\/h3>\n\n\n\n<p>Modify the following file to use MPS only for encoding:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-plain\"><code>audiocraft\/models\/encodec.py<\/code><\/pre><\/div>\n\n\n\n<p>The line numbers might vary depending on the version of the cloned repository, but the target is the <code>decode()<\/code> method within the <code>class EncodecModel(CompressionModel):<\/code>. Comment out the first <code>out = self.decoder(emb)<\/code> in the highlighted section and add the <code>if~else<\/code> block below it.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-file=\"audiocraft\/models\/encodec.py\" data-lang=\"Python\" data-line=\"252-259\" data-start=\"240\"><code>    def decode(self, codes: torch.Tensor, scale: tp.Optional[torch.Tensor] = None):\n        &quot;&quot;&quot;Decode the given codes to a reconstructed representation, using the scale to perform\n        audio denormalization if needed.\n\n        Args:\n            codes (torch.Tensor): Int tensor of shape [B, K, T]\n            scale (torch.Tensor, optional): Float tensor containing the scale value.\n\n        Returns:\n            out (torch.Tensor): Float tensor of shape [B, C, T], the reconstructed audio.\n        &quot;&quot;&quot;\n        emb = self.decode_latent(codes)\n        #out = self.decoder(emb)\n        # Below if block is added based on https:\/\/github.com\/facebookresearch\/audiocraft\/issues\/31\n        if emb.device.type == &#39;mps&#39;:\n            # XXX: Since mps-decoder does not work, cpu-decoder is used instead\n            out = self.decoder.to(&#39;cpu&#39;)(emb.to(&#39;cpu&#39;)).to(&#39;mps&#39;)\n        else:\n            out = self.decoder(emb)\n\n        out = self.postprocess(out, scale)\n        # out contains extra padding added by the encoder and decoder\n        return out<\/code><\/pre><\/div>\n\n\n\n<p>The code mentioned above was written by EbaraKoji (whose name suggests he might be Japanese?) from the following issue. I tried using his <a href=\"https:\/\/github.com\/EbaraKoji\/audiocraft\" target=\"_blank\" rel=\"noreferrer noopener\">forked repository<\/a>, but unfortunately, it didn&#8217;t work for me. <\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/facebookresearch\/audiocraft\/issues\/31#issuecomment-1705769295\">https:\/\/github.com\/facebookresearch\/audiocraft\/issues\/31#issuecomment-1705769295<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sample Code<\/h2>\n\n\n\n<p>This code below is slightly modified from something found elsewhere. Let&#8217;s put it in the <code>demos<\/code> directory along with other executable demo codes.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-file=\"demos\/audiogen_mps_app.py\" data-lang=\"Python\"><code>from audiocraft.models import AudioGen\nfrom audiocraft.data.audio import audio_write\nimport argparse\nimport time\n\nmodel = AudioGen.get_pretrained(&#39;facebook\/audiogen-medium&#39;, device=&#39;mps&#39;)\nmodel.set_generation_params(duration=5)  # generate [duration] seconds.\n\nstart = time.time()\ndef generate_audio(descriptions):\n  wav = model.generate(descriptions)  # generates samples for all descriptions in array.\n  \n  for idx, one_wav in enumerate(wav):\n      # Will save under {idx}.wav, with loudness normalization at -14 db LUFS.\n      audio_write(f&#39;{idx}&#39;, one_wav.cpu(), model.sample_rate, strategy=&quot;loudness&quot;, loudness_compressor=True)\n      print(f&#39;Generated {idx}.wav.&#39;)\n      print(f&#39;Elapsed time: {round(time.time()-start, 2)}&#39;)\n\nif __name__ == &quot;__main__&quot;:\n    parser = argparse.ArgumentParser(description=&quot;Generate audio based on descriptions.&quot;)\n    parser.add_argument(&quot;descriptions&quot;, nargs=&#39;+&#39;, help=&quot;List of descriptions for audio generation&quot;)\n    args = parser.parse_args()\n    \n    generate_audio(args.descriptions)<\/code><\/pre><\/div>\n\n\n\n<p>The key part is <code>device='mps'<\/code> on line 6. This instructs it to use the GPU for generation. Changing it to <code>'cpu'<\/code> will make generation slower but won&#8217;t consume as much memory. Also, there is another pre-trained smaller audio model <code>facebook\/audiogen-small<\/code> available, (I haven&#8217;t tested this one).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Usage<\/h2>\n\n\n\n<p>Note: The first time you run it, the pre-trained audio model will be downloaded, which may take some time.<\/p>\n\n\n\n<p>You can provide the desired sound in English as arguments, and it will generate audio files named <code>0.wav, 1.wav,\u2026<\/code>. The generation speed doesn&#8217;t increase much whether you provide one or multiple arguments, so I recommend generating several at once.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\"><code>python demos\/audiogen_mps_app.py &quot;text 1&quot; &quot;text 2&quot;<\/code><\/pre><\/div>\n\n\n\n<p>Example:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism off-numbers lang-zsh\" data-lang=\"ZSH\"><code>python demos\/audiogen_mps_app.py &quot;heavy rain with a clap of thunder&quot; &quot;knocking on a wooden door&quot; &quot;people whispering in a cave&quot; &quot;racing cars passing by&quot;\n\n\/Users\/handsome\/Documents\/Python\/AudioCraft_MPS\/.venv\/lib\/python3.11\/site-packages\/torch\/nn\/utils\/weight_norm.py:30: UserWarning: torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.\n  warnings.warn(&quot;torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.&quot;)\nGenerated 0.wav.\nElapsed time: 53.02\nGenerated 1.wav.\nElapsed time: 53.08\nGenerated 2.wav.\nElapsed time: 53.13\nGenerated 3.wav.\nElapsed time: 53.2<\/code><\/pre><\/div>\n\n\n\n<p>On an M2 Max with 32GB RAM, starting with low memory pressure, a 5-second file takes around 60 seconds to generate, and a 10-second file takes around 100 seconds.<\/p>\n\n\n\n<p>There&#8217;s a warning that appears right after running it, but since it works, I haven&#8217;t looked into it further. You can probably ignore it as long as you don&#8217;t<br>upgrade the PyTorch (torch) version.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">MPS cannot be used with MusicGen or MAGNeT.<\/h2>\n\n\n\n<p>I tried to make <strong>MusicGen<\/strong> work with MPS using a similar approach, but it didn&#8217;t succeed. It does run on CPU, so you can try the GUI with <code>python demos\/musicgen_app.py<\/code>.<\/p>\n\n\n\n<p><strong>MAGNeT<\/strong> seems to be a more advanced version, but I couldn&#8217;t get it running on CPU either. Looking at the following issue and the linked commit, it appears that it might work. However, I was unsuccessful in getting it to run myself.<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/facebookresearch\/audiocraft\/issues\/396\">https:\/\/github.com\/facebookresearch\/audiocraft\/issues\/396<\/a><\/p>\n\n\n\n<p>So, that concludes our exploration for now.<\/p>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>Image by Stable Diffusion (Mochi Diffusion)<br>This part, which I&#8217;ve been writing at the end of each article, will now only be visible to those who open this specific title. It&#8217;s not very relevant to the main content.<br>This time, it generated many good images with a simple prompt. I chose the one that seemed least likely to trigger claustrophobia.<br><\/summary>\n<p>Date:<br>2024-7-22 1:52:43<\/p>\n\n\n\n<p>Model:<br>realisticVision-v51VAE_original_768x512_cn<\/p>\n\n\n\n<p>Size:<br>768 x 512<\/p>\n\n\n\n<p>Include in Image:<br>future realistic image of audio generative AI<\/p>\n\n\n\n<p>Exclude from Image:<\/p>\n\n\n\n<p>Seed:<br>751124804<\/p>\n\n\n\n<p>Steps:<br>20<\/p>\n\n\n\n<p>Guidance Scale:<br>20.0<\/p>\n\n\n\n<p>Scheduler:<br>DPM-Solver++<\/p>\n\n\n\n<p>ML Compute Unit:<br>All<\/p>\n<\/details>\n","protected":false},"excerpt":{"rendered":"<p>Meta, the company behind Facebook, released AudioCraft \u2013 an AI capable of generating music and sound effects f &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Run Meta&#8217;s Audio Generation AI model, AudioGen, on macOS with MPS (GPU)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1622,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/blog.peddals.com\/?p=1601","footnotes":""},"categories":[25,8,4],"tags":[12,18],"class_list":["post-1626","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-ml","category-macos","category-python","tag-mac","tag-python","en-US"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Run Meta&#039;s Audio Generation AI model, AudioGen, on macOS with MPS (GPU) | Peddals Blog<\/title>\n<meta name=\"description\" content=\"Don&#039;t give up on running Meta&#039;s AudioGen with your Mac&#039;s GPU!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Run Meta&#039;s Audio Generation AI model, AudioGen, on macOS with MPS (GPU) | Peddals Blog\" \/>\n<meta property=\"og:description\" content=\"Don&#039;t give up on running Meta&#039;s AudioGen with your Mac&#039;s GPU!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/\" \/>\n<meta property=\"og:site_name\" content=\"Peddals Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-22T14:08:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-22T14:08:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/07\/future-realistic-image-of-audio-generative-AI.556.751124804.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"768\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Handsome\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Handsome\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"20 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/apple-mps-to-generate-audio-with-meta-audiogen\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/apple-mps-to-generate-audio-with-meta-audiogen\\\/\"},\"author\":{\"name\":\"Handsome\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\"},\"headline\":\"Run Meta&#8217;s Audio Generation AI model, AudioGen, on macOS with MPS (GPU)\",\"datePublished\":\"2024-07-22T14:08:41+00:00\",\"dateModified\":\"2024-07-22T14:08:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/apple-mps-to-generate-audio-with-meta-audiogen\\\/\"},\"wordCount\":873,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/apple-mps-to-generate-audio-with-meta-audiogen\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/future-realistic-image-of-audio-generative-AI.556.751124804.jpg\",\"keywords\":[\"mac\",\"Python\"],\"articleSection\":[\"AI\\\/LLM\",\"macOS\",\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.peddals.com\\\/en\\\/apple-mps-to-generate-audio-with-meta-audiogen\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/apple-mps-to-generate-audio-with-meta-audiogen\\\/\",\"url\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/apple-mps-to-generate-audio-with-meta-audiogen\\\/\",\"name\":\"Run Meta's Audio Generation AI model, AudioGen, on macOS with MPS (GPU) | Peddals Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/apple-mps-to-generate-audio-with-meta-audiogen\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/apple-mps-to-generate-audio-with-meta-audiogen\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/future-realistic-image-of-audio-generative-AI.556.751124804.jpg\",\"datePublished\":\"2024-07-22T14:08:41+00:00\",\"dateModified\":\"2024-07-22T14:08:42+00:00\",\"description\":\"Don't give up on running Meta's AudioGen with your Mac's GPU!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/apple-mps-to-generate-audio-with-meta-audiogen\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.peddals.com\\\/en\\\/apple-mps-to-generate-audio-with-meta-audiogen\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/apple-mps-to-generate-audio-with-meta-audiogen\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/future-realistic-image-of-audio-generative-AI.556.751124804.jpg\",\"contentUrl\":\"https:\\\/\\\/blog.peddals.com\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/future-realistic-image-of-audio-generative-AI.556.751124804.jpg\",\"width\":768,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/en\\\/apple-mps-to-generate-audio-with-meta-audiogen\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/blog.peddals.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Run Meta&#8217;s Audio Generation AI model, AudioGen, on macOS with MPS (GPU)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#website\",\"url\":\"https:\\\/\\\/blog.peddals.com\\\/\",\"name\":\"Peddals Blog\",\"description\":\"AI, LLM, Python, Mac, Pythonista3, iOS, etc. in Japanese and English\",\"publisher\":{\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.peddals.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/blog.peddals.com\\\/#\\\/schema\\\/person\\\/81b2dabca748c3d11a45722f02d9d994\",\"name\":\"Handsome\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\",\"caption\":\"Handsome\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Run Meta's Audio Generation AI model, AudioGen, on macOS with MPS (GPU) | Peddals Blog","description":"Don't give up on running Meta's AudioGen with your Mac's GPU!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/","og_locale":"en_US","og_type":"article","og_title":"Run Meta's Audio Generation AI model, AudioGen, on macOS with MPS (GPU) | Peddals Blog","og_description":"Don't give up on running Meta's AudioGen with your Mac's GPU!","og_url":"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/","og_site_name":"Peddals Blog","article_published_time":"2024-07-22T14:08:41+00:00","article_modified_time":"2024-07-22T14:08:42+00:00","og_image":[{"width":768,"height":512,"url":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/07\/future-realistic-image-of-audio-generative-AI.556.751124804.jpg","type":"image\/jpeg"}],"author":"Handsome","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Handsome","Est. reading time":"20 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/#article","isPartOf":{"@id":"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/"},"author":{"name":"Handsome","@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994"},"headline":"Run Meta&#8217;s Audio Generation AI model, AudioGen, on macOS with MPS (GPU)","datePublished":"2024-07-22T14:08:41+00:00","dateModified":"2024-07-22T14:08:42+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/"},"wordCount":873,"commentCount":0,"publisher":{"@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994"},"image":{"@id":"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/07\/future-realistic-image-of-audio-generative-AI.556.751124804.jpg","keywords":["mac","Python"],"articleSection":["AI\/LLM","macOS","Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/","url":"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/","name":"Run Meta's Audio Generation AI model, AudioGen, on macOS with MPS (GPU) | Peddals Blog","isPartOf":{"@id":"https:\/\/blog.peddals.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/#primaryimage"},"image":{"@id":"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/07\/future-realistic-image-of-audio-generative-AI.556.751124804.jpg","datePublished":"2024-07-22T14:08:41+00:00","dateModified":"2024-07-22T14:08:42+00:00","description":"Don't give up on running Meta's AudioGen with your Mac's GPU!","breadcrumb":{"@id":"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/#primaryimage","url":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/07\/future-realistic-image-of-audio-generative-AI.556.751124804.jpg","contentUrl":"https:\/\/blog.peddals.com\/wp-content\/uploads\/2024\/07\/future-realistic-image-of-audio-generative-AI.556.751124804.jpg","width":768,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/blog.peddals.com\/en\/apple-mps-to-generate-audio-with-meta-audiogen\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/blog.peddals.com\/"},{"@type":"ListItem","position":2,"name":"Run Meta&#8217;s Audio Generation AI model, AudioGen, on macOS with MPS (GPU)"}]},{"@type":"WebSite","@id":"https:\/\/blog.peddals.com\/#website","url":"https:\/\/blog.peddals.com\/","name":"Peddals Blog","description":"AI, LLM, Python, Mac, Pythonista3, iOS, etc. in Japanese and English","publisher":{"@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.peddals.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/blog.peddals.com\/#\/schema\/person\/81b2dabca748c3d11a45722f02d9d994","name":"Handsome","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g","caption":"Handsome"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/51d7363349ec538c4d62c9ebe89488fd7388729ad0c9dfeebd8bb32ebfb11f17?s=96&d=mm&r=g"}}]}},"_links":{"self":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts\/1626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/comments?post=1626"}],"version-history":[{"count":13,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts\/1626\/revisions"}],"predecessor-version":[{"id":1640,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/posts\/1626\/revisions\/1640"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/media\/1622"}],"wp:attachment":[{"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/media?parent=1626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/categories?post=1626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.peddals.com\/wp-json\/wp\/v2\/tags?post=1626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}