Skip to main content

nonebot

nonebot-plugin-vits-tts

✨ 基于vits的nonebot语音合成插件 ✨

license Python pypi

📖 介绍

基于vits的tts语音生成,适配onebot v11协议
已兼容pydantic v1&v2

💿 安装

nb-cli
nb plugin install nonebot-plugin-vits-tts
pip
pip install nonebot_plugin_vits_tts

⚙️ 配置

配置项 类型 默认值 说明
VITS__DEVICE int 0 使用指定的cuda设备进行tts合成,如果指定的设备不存在会自动使用cpu进行推理
VITS__VMODEL_PATH str models 插件会读取此文件夹下的所有模型
VITS__AT_BOT bool false 使用语音合成是否需要@bot
VITS__COOLDOWN int 0 在每个群里生成语音的冷却时间,防止设备负载过大
VITS__VMODEL_FILE_NAME str model.pth 模型文件名
VITS__CONFIG_FILE_NAME str config 模型配置文件
VITS__TENCENT_SECRET_ID str 腾讯云机器翻译SECRET_ID,用于语种识别
VITS__TENCENT_SECRET_KEY str 腾讯云机器翻译SECRET_KEY,这两项不配置或者配置不正确会使用langdetect库进行语种识别,使用langdetect准确率较低
VITS__DEFAULT_LENGTH_SCALE float 1 整体语速
VITS__DEFAULT_NOISE_SCALE float 0.667 感情变化程度
VITS__DEFAULT_NOISE_SCALE_W float 0.6 音素发音长度
VITS__AUDIO_CONVERT_TO_MP3 bool false 是否将语音转换为mp3格式,默认为wav格式,如果设置为true,需要在设备上安装ffmpeg

假如你的项目配置是这样,则VITS__VMODEL_PATH应为models,VITS__VMODEL_FILE_NAME为model.pth,VITS__CONFIG_FILE_NAME 为config.json

awsomebot
├─ .env
├─ .env.dev
├─ .env.prod
├─ .gitignore
├─ README.md
├─ models
│    ├─ model1
│    │    ├─ config.json
│    │    └─ model.pth
│    └─ model2
│           ├─ config.json
│           └─ model.pth
├─ pyproject.toml
└─ src
   └─ plugins
      └─ ...

注意
所有的模型文件名应为VITS__VMODEL_FILE_NAME的值,配置文件名应为VITS__CONFIG_FILE_NAME的值,一个文件夹只允许放一个模型和配置文件, 不同模型使用文件夹分割开来,插件会自动加载所有文件夹下的模型

使用cuda设备合成音频

🎉 使用

仅可以在群聊中使用
使用方法:

  • [角色]说[要合成的文本]
    例如:

    • 宁宁说私のオナニを見てください
  • 发送/help 可以获取可用角色列表

目前仅支持简体中文,日语,英文,插件会自动识别要合成文本的语种

模型分享

由我自己训练的模型,目前有以下几个galgame的模型
ATRI, RiddleJoker, 千恋万花, 魔女的夜宴, 星光咖啡馆与死神之蝶

模型不定期更新,可前往我的huggingface主页查看

💡 感谢

关于模型训练

Plachtaa/VITS-fast-fine-tuning的笔记本
另外还提供一个我改进过的笔记本 ,这个笔记本只保存最新的模型文件,不会将训练的中间文件保存到云盘导致云盘爆掉不能训练

Metadata

Release files for nonebot-plugin-vits-tts 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-vits-tts 0.1.7
File Size Uploaded Provenance Actions
nonebot_plugin_vits_tts-0.1.7.tar.gz 43.3 kB Without provenance Details for nonebot_plugin_vits_tts-0.1.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-vits-tts 0.1.7
File Interpreter ABI Platform Actions
nonebot_plugin_vits_tts-0.1.7-py3-none-any.whl Python 3 none any Details for nonebot_plugin_vits_tts-0.1.7-py3-none-any.whl

Total release size: 93.6 kB

Release files / nonebot_plugin_vits_tts-0.1.7.tar.gz

Download URL nonebot_plugin_vits_tts-0.1.7.tar.gz
Size 43.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cb23714f2de89d64bb3a6a85ca41b30dcf51761bb2d4adb1f2375b694f418426
BLAKE2b-256 checksum
How to use checksums
c43d07dc50301f451eecdc672f656eeaeb772abd6049fe666f139abbe039c72b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / nonebot_plugin_vits_tts-0.1.7-py3-none-any.whl

Download URL nonebot_plugin_vits_tts-0.1.7-py3-none-any.whl
Size 50.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4618ed7aef2ff5853f5e12e797c3e5f82d0ab90db6a7bbbe6949e65c2df8218a
BLAKE2b-256 checksum
How to use checksums
4a2f39d03795716616836f5caeffa2cdf21c367bf5b373b6aef2c51d5b5a6cf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Security for nonebot-plugin-vits-tts 0.1.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page