Moshi: 開源版 GPT-4 級語音 AI 問世 - ALM

在 2024年9月
@kyutai_labs 在 Huggingface 以及 GitHub 上釋出了即時語音對話模型,該模型是個 7B 模型,如果你有張 RTX 3090 24GB 或者與之大小相符的顯卡就可以跑這顆 Model 了,再來就可能要選擇量化模型了。
相信大家可能或多或少都有看到這篇在 X 上的貼文,這是一個來自法國的初創團隊 Kyutai,在七月初發佈對標 GPT-4o 的神奇模型。經歷兩個多月的時間,他們也對兌現自己的承諾,不僅把模型開源,甚至程式碼也開源了!
論文: https://kyutai.org/Moshi.pdf
開源程式碼: https://github.com/kyutai-labs/moshi
開源模型: https://huggingface.co/collections/kyutai/moshi-…
線上體驗: moshi.chat
大家可以去官網體驗看看 (moshi.chat),能夠在落地的環境採用這些像人一般的模型,還是很奇妙的。
甚至我心目中的 AI 英雄 Andrej Karpathy 也在 X 上給出了讚賞
技術細節
模型參數量: 7.69B
支援平台: PyTorch、Candle、MLX
語音輸入處理: Mimi; a neural audio codec (paper:3)
ALM 架構: 結合 Helium 和較小的 Transformer 模型
模型的參數量約為 7.96B,模型支援以下三種平台 PyTorch、MLX(An array framework for Apple silicon) 以及 Candle (Minimalist ML framework for Rust),如果你想執行 Quantized 的模型,則 Candle 提供了 8bit 的版本,MLX 則還有 4bit 的可以使用。
Python (MLX) for local inference on macOS
Installation
假如你想在自己電腦上執行 moshi,以下是 Mac 的快速安裝。
你至少需要 Python 3.10,建議使用 3.12。有關具體需求,請查看個別狀況而定。
你可以使用下列方式安裝 PyTorch 和 MLX 用戶端:
pip install moshi # moshi PyTorch, from PyPI
pip install moshi_mlx # moshi MLX, from PyPI, best with Python 3.12.
# Or the bleeding edge versions for Moshi and Moshi-MLX.
pip install -e "git+https://git@github.com/kyutai-labs/moshi.git#egg=moshi&subdirectory=moshi"
pip install -e "git+https://git@github.com/kyutai-labs/moshi.git#egg=moshi_mlx&subdirectory=moshi_mlx"
pip install rustymimi # mimi, rust implementation with Python bindings from PyPI
local inference
python -m moshi_mlx.local -q 4 # 執行 4bit 模型;weights quantized to 4 bits
python -m moshi_mlx.local -q 8 # 執行 8bit 模型;weights quantized to 8 bits
# 使用其他不同的預訓練模型:
python -m moshi_mlx.local -q 4 --hf-repo kyutai/moshika-mlx-q4
python -m moshi_mlx.local -q 8 --hf-repo kyutai/moshika-mlx-q8
# 請注意要配合使用 "-q" 以及 "--hf-repo"
如果想了解 Moshi 更細緻的技術細節,可以透過下方訂閱我的 News letter 即時追蹤 AI 產業的最新趨勢。
Subscribe to my newsletter
Read articles from ZoneTwelve directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
