隨著生成式AI的快速發展,音樂生成技術已取得重大突破,能夠從文字直接生成具備人聲與伴奏的完整歌曲。然而,現有的開源模型多針對英語或華語開發,且推論過程需要極龐大的運算資源,對普及化與本土語言的支持造成限制。本論文旨在於硬體資源受限的環境下(如限制於 8GB VRAM 的 NVIDIA RTX 3050),實作並優化一個高效能的音樂生成平台。 本研究以開源的 YuE 7B 基礎模型為核心,透過動態攔截注入(Monkey Patch) 技術,成功套用4-bit Normal Float 4 (4-bit NF4)量化,將模型顯示卡記憶體占用由原生的 28GB 大幅壓縮至約 7.7GB,有效避免記憶體不足錯誤。文中廣泛整理 HeartMuLa、LeVo 等最新音樂生成領域之技術發展,並透過實際建置 SongGen 與 YuE 模型進行推論對比,驗證單階段與雙階段自迴歸模型在生成穩定度與音質表現上之差異。 實驗結果顯示,優化後的系統能成功在消費級顯示卡上完成歌詞的輸入與音樂生成,並解決 Windows 環境下的編碼相容性錯誤及音訊儲存的碼率損失,提出具體的改良策略。此外,本平台亦奠定後續訓練與擴展至台語等本土語言生成的技術基礎。;With the rapid development of generative AI, music generation technology has made significant breakthroughs, enabling the direct generation of full songs with both vocals and accompaniment from text. However, existing open-source models are primarily developed for English or Mandarin, and their inference process requires massive computational resources, which limits their widespread adoption and support for local languages. This thesis aims to implement and optimize a high-performance music generation platform in hardware-constrained environments (such as being limited to an NVIDIA RTX 3050 with 8GB VRAM). Using the open-source YuE 7B foundation model as the core, this study successfully applies 4-bit Normal Float 4 (4-bit NF4) quantization through dynamic interception and injection via Monkey Patch technology. This significantly compresses the model′s GPU memory footprint from its native 28GB to approximately 7.7GB, effectively preventing out-of-memory errors. The paper comprehensively reviews recent technological advancements in the music generation field, such as HeartMuLa and LeVo. Furthermore, through the practical implementation and inference comparison of the SongGen and YuE models, it verifies the differences in generation stability and audio quality between single-stage and two-stage autoregressive models. Experimental results demonstrate that the optimized system can successfully process lyrics input and music generation on consumer-grade GPUs. It also resolves encoding compatibility errors and audio storage bitrate loss in the Windows environment, proposing specific improvement strategies. Furthermore, this platform lays the technical foundation for future training and expansion into the generation of local languages such as Taiwanese.