微信扫码
添加专属顾问
我要投稿
低显存也能玩转多模态数字人!阿里开源OpenAvatarChat实测仅需4G显存,Windows本地部署教程来了。 核心内容: 1. OpenAvatarChat的多模态能力与低显存优势 2. 详细硬件需求与本地部署步骤 3. 实测性能数据与运行效果展示
Open Avatar Chat 是由阿里开源的数字人对话系统,让数字人具备视觉感知+语音交互+情感表达多模态能力,能达到类似真人的对话体验。
本教程将采用硬件需求最低的部署方案:SenseVoice
+ LLM API
+ CosyVoice API
的方式运行 LAM 或 LiteAvatar 数字人。显存占用最低仅有3G!
在搭载 RTX3060 6G
的笔记本电脑上运行测试
运行LAM数字人
,仅占用3.1G
显存!对话流畅,性能相当强悍!
实测图如下:
运行LiteAvatar数字人
,也仅需5.3G
显存!实测图如下:
安装 miniconda 、ffmpeg 可查看往期文章
• 安装miniconda • 安装ffmpeg
# 拉取主仓库 --depth=1 仅拉取最新的提交,减少空间占用
git clone --depth=1 https://github.com/HumanAIGC-Engineering/OpenAvatarChat.git
cd OpenAvatarChat
# 拉取子仓库
git submodule update --init --recursive
针对网络环境不好的同学,推荐逐个拉取仓库。在拉取失败时能快速定位到异常仓库。
所有git clone命令均带有路径,可直接在主仓库根目录下执行。
注:由于是最小化组件安装,没有拉取MiniCPM-o仓库
所有子仓库可在
.gitmodules
文件中查看
git clone --depth=1 https://github.com/HumanAIGC-Engineering/OpenAvatarChat.git
cd OpenAvatarChat
# 跳过lfs下载大型文件,后续把大型文件单独下载后放入指定位置
# set GIT_LFS_SKIP_SMUDGE=1
git clone --depth=1 https://github.com/HumanAIGC/lite-avatar.git ./src/handlers/avatar/liteavatar/algo/liteavatar
liteavatar仓库中共有三个大型文件,把它们单独下载到本地再放到对应位置:
git clone --depth=1 https://github.com/snakers4/silero-vad.git ./src/handlers/vad/silerovad/silero_vad
git clone --depth=1 https://github.com/HumanAIGC-Engineering/gradio-webrtc.git ./src/third_party/gradio_webrtc_videochat
# CosyVoice 仓库中包含子仓库:Matcha-TTS。添加参数 --recursive 将自动拉取
git clone --depth=1 --recursive https://github.com/FunAudioLLM/CosyVoice.git ./src/handlers/tts/cosyvoice/CosyVoice
git clone --depth=1 https://github.com/aigc3d/LAM_Audio2Expression.git ./src/handlers/avatar/lam/LAM_Audio2Expression
# 新建名为 openavatarchat 的 python 3.10 环境
conda create -n openavatarchat python=3.10
# 激活环境
conda activate openavatarchat
conda install -c conda-forge pynini==2.1.6
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
这个fastrtc是经过OpenAvatarChat团队修改的版本,且打包成了whl包,跟随OpenAvatarChat仓库发布。千万不要安装gradio版的fastrtc
pip install -i https://mirrors.aliyun.com/pypi/simple ./src/third_party/gradio_webrtc_videochat/dist/fastrtc-0.0.19.dev0-py3-none-any.whl
请严格按照以下顺序安装依赖包。已经过多轮测试,安装后可正常运行。
pip install -i https://mirrors.aliyun.com/pypi/simple aiohttp==3.11.16
pip install -i https://mirrors.aliyun.com/pypi/simple modelscope==1.25.0
pip install -i https://mirrors.aliyun.com/pypi/simple openai==1.74.0
pip install -i https://mirrors.aliyun.com/pypi/simple dynaconf==3.2.10
pip install -i https://mirrors.aliyun.com/pypi/simple email-validator==2.2.0
pip install -i https://mirrors.aliyun.com/pypi/simple fastapi-cli==0.0.7
pip install -i https://mirrors.aliyun.com/pypi/simple loguru==0.7.3
pip install -i https://mirrors.aliyun.com/pypi/simple opencv-python-headless==4.11.0.86
pip install -i https://mirrors.aliyun.com/pypi/simple pyaml==25.1.0
pip install -i https://mirrors.aliyun.com/pypi/simple funasr==1.2.6
pip install -i https://mirrors.aliyun.com/pypi/simple vocos==0.1.0
pip install -i https://mirrors.aliyun.com/pypi/simple vector-quantize-pytorch==1.21.9
pip install -i https://mirrors.aliyun.com/pypi/simple transformers==4.44.1
pip install -i https://mirrors.aliyun.com/pypi/simple h5py==3.12.1
pip install -i https://mirrors.aliyun.com/pypi/simple pypinyin==0.53.0
pip install -i https://mirrors.aliyun.com/pypi/simple typeguard==2.13.3
pip install -i https://mirrors.aliyun.com/pypi/simple onnxruntime-gpu~=1.20.1
pip install -i https://mirrors.aliyun.com/pypi/simple onnxruntime~=1.20.1
pip install -i https://mirrors.aliyun.com/pypi/simple dashscope==1.23.1
pip install -i https://mirrors.aliyun.com/pypi/simple edge-tts==7.0.0
pip install -i https://mirrors.aliyun.com/pypi/simple addict==2.4.0
pip install -i https://mirrors.aliyun.com/pypi/simple yapf==0.40.1
pip install -i https://mirrors.aliyun.com/pypi/simple spleeter==2.4.0
pip install -i https://mirrors.aliyun.com/pypi/simple gradio==5.9.1
模型文件均来自 modelscope
魔塔社区,无需担心网络问题。
在OpenAvatarChat根目录下执行,模型文件会下载到对应的文件夹中
modelscope download --model iic/SenseVoiceSmall --local_dir ./models/iic/SenseVoiceSmall
modelscope download --model HumanAIGC-Engineering/LiteAvatarGallery --local_dir ./resource/avatar/liteavatar
modelscope download --model AI-ModelScope/wav2vec2-base-960h --local_dir ./models/wav2vec2-base-960h
modelscope download --model Damo_XR_Lab/LAM_audio2exp LAM_audio2exp_streaming.tar --local_dir ./models/LAM_audio2exp
注意:这里的 LAM_audio2exp_streaming.tar 压缩包需要解压,否则在运行lam数字人时报错:No checkpoint found
使用WinRAR解压有可能会遇到只解压出一个文件的问题,正常解压出来的应当是一个文件夹。猜测可能是解压软件的问题。遇到问题的同学可以修改LAM_audio2exp_streaming.tar文件后缀名为.tar.gz即可使用WinRAR解压。
如下图:
解后的目录结构为:
./models/LAM_audio2exp/pretrained_models
/LAM_audio2exp_streaming.tar
https://bailian.console.aliyun.com/?tab=model#/model-market/detail/cosyvoice-v1
当白嫖额度消耗殆尽时,可在配置文件中替换为EDGE-TTS语言合成,但速度稍慢
https://bailian.console.aliyun.com/?tab=model#/model-market/detail/qwen-vl-plus
https://openrouter.ai/qwen/qwen2.5-vl-72b-instruct:free
在登录阿里云百炼后,所使用模型的白嫖额度会显示在页面中,注意查看:
配置文件位于:config 文件夹内
chat_with_openai_compatible_bailian_cosyvoice.yaml
到同目录内,重命名为liteavatar.yaml
若是使用OpenRouter
的 LLM大模型,则要修改 model_name、api_url、api_key。如下图示例:
chat_with_openai_compatible_bailian_cosyvoice.yaml
到同目录内,重命名为lam.yaml
LamClient:
module: client/h5_rendering_client/client_handler_lam
asset_path: "lam_samples/image.zip"
concurrent_limit: 5
参考下图:
4.把LiteAvatar删除,替换为LAM_Driver
LAM_Driver:
module: avatar/lam/avatar_handler_lam_audio2expression
参考下图:
1. 编辑yaml配置文件
2. 把CosyVoice配置项删除,或者把CosyVoice配置项的enabled
改为False
3. 把下面的Edge_TTS配置项添加到配置文件中去
Edge_TTS:
enabled: True
module: tts/edgetts/tts_handler_edgetts
voice: "zh-CN-XiaoxiaoNeural"
python src/demo.py --config config/liteavatar.yaml
python src/demo.py --config config/lam.yaml
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费场景POC验证,效果验证后签署服务协议。零风险落地应用大模型,已交付160+中大型企业
2025-06-16
开源AI工具Magentic UI,凭什么让你的工作效率提升300%?
2025-06-16
【AI工具】一款开源AI画布产品,堪比手动版 Manus。一套工作流告诉你它有多强!
2025-06-16
ollama 大版本0.9 发布,支持流式响应和推理模式
2025-06-16
MinerU:AI时代的文档解析利器
2025-06-16
专家级提示词工程师,都在偷偷用这个开源神器!一键部署+批量优化,效率提升1000%
2025-06-16
我开源了给老师们的“填表神器”,一键生成“教案”,聊聊AI如何真正帮到普通人
2025-06-15
如何用Gradio搭建一个完整的AI产品功能?
2025-06-15
字节跳动开源的工作流引擎真有点东西
2025-03-19
2025-03-19
2025-04-01
2025-04-13
2025-04-01
2025-04-29
2025-03-19
2025-03-23
2025-03-22
2025-04-12
2025-06-16
2025-06-15
2025-06-14
2025-06-10
2025-06-08
2025-05-28
2025-05-28
2025-05-26