Metavoice-1b是一种1.2B参数基本模型,该模型在TTS的100K语音(文本到语音)上训练。它的构建具有以下优先级:
我们将在Apache 2.0许可下释放Metavoice-1B,可以使用它而无限制。
Web UI
docker-compose up -d ui && docker-compose ps && docker-compose logs -f服务器
# navigate to <URL>/docs for API definitions
docker-compose up -d server && docker-compose ps && docker-compose logs -f先决条件:
环境设置
# install ffmpeg
wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz
wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz.md5
md5sum -c ffmpeg-git-amd64-static.tar.xz.md5
tar xvf ffmpeg-git-amd64-static.tar.xz
sudo mv ffmpeg-git- * -static/ffprobe ffmpeg-git- * -static/ffmpeg /usr/local/bin/
rm -rf ffmpeg-git- *
# install rust if not installed (ensure you've restarted your terminal after installation)
curl --proto ' =https ' --tlsv1.2 -sSf https://sh.rustup.rs | sh # install poetry if not installed (ensure you've restarted your terminal after installation)
pipx install poetry
# disable any conda envs that might interfere with poetry's venv
conda deactivate
# if running from Linux, keyring backend can hang on `poetry install`. This prevents that.
export PYTHON_KEYRING_BACKEND=keyring.backends.fail.Keyring
# pip's dependency resolver will complain, this is temporary expected behaviour
# full inference & finetuning functionality will still be available
poetry install && poetry run pip install torch==2.2.1 torchaudio==2.2.1注意1:提出问题时,我们会要求您先尝试诗歌。注2:默认情况下,此读书中的所有命令都使用poetry ,因此您只需删除任何poetry run即可。
pip install -r requirements.txt
pip install torch==2.2.1 torchaudio==2.2.1
pip install -e . # You can use `--quantisation_mode int4` or `--quantisation_mode int8` for experimental faster inference. This will degrade the quality of the audio.
# Note: int8 is slower than bf16/fp16 for undebugged reasons. If you want fast, try int4 which is roughly 2x faster than bf16/fp16.
poetry run python -i fam/llm/fast_inference.py
# Run e.g. of API usage within the interactive python session
tts.synthesise(text= " This is a demo of text to speech by MetaVoice-1B, an open-source foundational audio model. " , spk_ref_path= " assets/bria.mp3 " )注意:脚本需要30-90秒才能启动(取决于硬件)。这是因为我们对快速推理模型进行了折磨。
在Ampere,Ada-Lovelace和Hopper Architecture GPU上,一旦编译,Synthesise()API的运行速度比实时因子(RTF)<1.0快。
# You can use `--quantisation_mode int4` or `--quantisation_mode int8` for experimental faster inference. This will degrade the quality of the audio.
# Note: int8 is slower than bf16/fp16 for undebugged reasons. If you want fast, try int4 which is roughly 2x faster than bf16/fp16.
# navigate to <URL>/docs for API definitions
poetry run python serving.py
poetry run python app.py我们支持FINETUNTINE fineTuning first Stage LLM(请参阅体系结构部分)。
为了获得Finetune,我们期望以下格式的“ |”限制在以下格式的CSV数据集:
audio_files|captions
./data/audio.wav|./data/caption.txt
请注意,我们没有执行任何数据集重叠检查,因此请确保您的火车和Val数据集是不相交的。
通过以下方式使用我们的示例数据集尝试一下
poetry run finetune --train ./datasets/sample_dataset.csv --val ./datasets/sample_val_dataset.csv训练模型后,您可以将其用于推断:
poetry run python -i fam/llm/fast_inference.py --first_stage_path ./my-finetuned_model.pt为了设置超参数,例如学习率,冻结的内容等,您可以编辑Finetune_params.py文件。
我们已经与W&B进行了轻巧的可选集成,可以通过设置wandb_log = True &通过安装适当的依赖项来启用。
poetry install -E observable我们从文本和扬声器信息中预测Encodec令牌。然后将其扩散到波形水平,并应用后处理以清理音频。
模型支持:
我们感谢他们在一起的24/7帮助,以编造我们的集群。我们感谢AWS,GCP和Hugging Face的团队为他们的云平台提供支持。
如果我们错过了任何人,请提前道歉。如果我们有,请告诉我们。