Coder Social home page Coder Social logo

nonebot-plugin-bertvits2's Introduction

nonebot-plugin-bertvits2

✨ bertVits2 语音合成插件 ✨

介绍

bertvits2的nonebot2插件,直接对接bertvits2项目的自带api。

安装

由于bertvits2语音合成需要较长的时间,尤其是cpu推理时。因此不提供插件直接推理的实现,否则会产生较长时间的卡顿。本插件依赖于bertvits2本体的api服务。 该项目的api服务实现亦由本作者维护,因此一般来说,当插件更新时同步更新bertvits2至最新release即可。

1. bertvits2安装

  • 下载bertvits22.0.1 release(包括release的UI文件)
  • 环境安装
  • bertvits2server_fastapi.py替换为本项目中的server_fastapi.py
  • 运行server_fastapi.py,第一次运行默认退出,生成config.yml文件,并按文件说明对server属性进行配置
  • 运行server_fastapi.py

2. 插件安装

2.1 使用 nb-cli 安装

nb plugin install nonebot-plugin-bertvits2

2.2 使用pip安装

pip install nonebot-plugin-bertvits2

3.配置

本插件需要在 nonebot2 项目的.env文件中添加下表中的配置

配置项 必填 默认值 说明
bertvits_host "http://127.0.0.1" bertVits api的host
bertvits_port 5000 bertVits api的port
bertvits_auto_translate false 是否使用bertVits的机翻,开启需要百度api,详见bertVits的config.yml

使用

  • 语音人物列表 : 查看当前bertvits2已加载模型人物
  • 刷新人物列表 : 刷新当前bertvits2已加载模型人物
  • xxx说xxxx : bertVits语音合成,前为人物名,后为要说的话。
  • xxx中文/日语/英语说xxxx :同上,指定目标语言

nonebot-plugin-bertvits2's People

Contributors

jiangyuxiaoxiao avatar

Stargazers

Lisita avatar  avatar  avatar  avatar 39c5bb avatar

Watchers

 avatar  avatar

nonebot-plugin-bertvits2's Issues

不生成语音

按流程部署完后输入指令不会生成语音,所有插件配置均使用的默认值。
`以下是nonebot的日志:

12-10 20:59:28 [SUCCESS] nonebot | NoneBot is initializing...
12-10 20:59:28 [INFO] nonebot | Current Env: dev
12-10 20:59:28 [DEBUG] nonebot | Loaded Config: {'driver': '~aiohttp', 'host': IPv4Address('127.0.0.1'), 'port': 13579, 'log_level': 'DEBUG', 'api_timeout': 30.0, 'superusers': set(), 'nickname': set(), 'command_start': {'/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=120), 'qq_bots': [{'id': '', 'token': '', 'secret': '', 'intent': {'guild_messages': True, 'c2c_group_at_messages': False, 'direct_message': True}}], 'qq_is_sandbox': False, 'environment': 'dev'}
12-10 20:59:29 [DEBUG] nonebot | Succeeded to load adapter "QQ"
12-10 20:59:29 [SUCCESS] nonebot | Succeeded to load plugin "echo" from "nonebot.plugins.echo"
12-10 20:59:29 [DEBUG] nonebot | OneBot V12 | Model for key "" <class 'nonebot.adapters.onebot.v12.event.BotEvent'> is overridden by <class 'nonebot.adapters.onebot.v12.event.Event'>
12-10 20:59:30 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_mystool"
12-10 20:59:30 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_bertvits2" from "src.plugins.nonebot_plugin_bertvits2"
12-10 20:59:30 [SUCCESS] nonebot | Running NoneBot...
12-10 20:59:30 [DEBUG] nonebot | Loaded adapters: QQ
12-10 20:59:30 [DEBUG] nonebot | QQ | QQ run in sandbox mode: False
12-10 20:59:30 [DEBUG] nonebot | QQ | QQ api base url: https://api.sgroup.qq.com/
12-10 20:59:30 [DEBUG] nonebot | QQ | Bot 102080840 calling API shard_url_get
12-10 20:59:30 [INFO] nonebot_plugin_apscheduler | Scheduler Started
12-10 20:59:30 [DEBUG] nonebot | QQ | WebSocket Connection to wss://api.sgroup.qq.com/websocket established
12-10 20:59:31 [INFO] nonebot | QQ | Bot xxxx connected
12-10 20:59:31 [SUCCESS] nonebot | QQ xxxx | [EventType.READY]: {'version': 1, 'session_id': 'c30ebda8-9f6a-4c10-9d84-1b19f575db16', 'user': {'id': '6698548111176471905', 'username': 'Doro-测试中', 'avatar': None, 'bot': True, 'union_openid': None, 'union_user_account': None}, 'shard': (0, 1)}
12-10 20:59:31 [DEBUG] nonebot | Checking for matchers in priority 1...
12-10 20:59:31 [DEBUG] nonebot | Checking for matchers in priority 4...
12-10 20:59:31 [DEBUG] nonebot | Checking for matchers in priority 5...
12-10 20:59:31 [DEBUG] nonebot | Checking for matchers in priority 100...
12-10 20:59:31 [DEBUG] nonebot | Checking for matchers completed
12-10 20:59:31 [INFO] nonebot | Application startup completed.
12-10 20:59:39 [SUCCESS] nonebot | QQ 102888840 | [EventType.AT_MESSAGE_CREATE]: Message 08a8fc8f90e9b1fff12d10ef84bdae02386f48baecd6ab06 from  @[Guild:3306765342596994600/634339951] Roles:['4', '14']: [Text(type='text', data={'text': '星 瞳说你好啊,我是星瞳'})]
12-10 20:59:39 [DEBUG] nonebot | Checking for matchers in priority 1...
12-10 20:59:39 [SUCCESS] nonebot | QQ 102888840 | [EventType.MESSAGE_CREATE]: Message 08a8fc8f90e9b1fff12d10ef88bdae02386f48baecd6ab06 from  @[Guild:330676534019699880/634339951] Roles:['4', '14']: [Text(type='text', data={'text': '星瞳说你好啊,我是星瞳'})]
12-10 20:59:39 [DEBUG] nonebot | Checking for matchers in priority 1...
12-10 20:59:39 [DEBUG] nonebot | Checking for matchers in priority 4...
12-10 20:59:39 [DEBUG] nonebot | Checking for matchers in priority 4...
12-10 20:59:39 [DEBUG] nonebot | Checking for matchers in priority 5...
12-10 20:59:39 [DEBUG] nonebot | Checking for matchers in priority 5...
12-10 20:59:39 [DEBUG] nonebot | Checking for matchers in priority 100...
12-10 20:59:39 [DEBUG] nonebot | Checking for matchers in priority 100...
12-10 20:59:39 [INFO] nonebot | Event will be handled by Matcher(type='message', module=src.plugins.nonebot_plugin_bertvits2, lineno=35)
12-10 20:59:39 [DEBUG] nonebot | Running Matcher(type='message', module=src.plugins.nonebot_plugin_bertvits2, lineno=35)
12-10 20:59:39 [DEBUG] nonebot | Running handler Dependent(call=_)
12-10 20:59:39 [DEBUG] nonebot | Handler Dependent(call=_) skipped
12-10 20:59:39 [INFO] nonebot | Matcher(type='message', module=src.plugins.nonebot_plugin_bertvits2, lineno=35) running complete
12-10 20:59:39 [DEBUG] nonebot | Checking for matchers completed
12-10 20:59:39 [INFO] nonebot | Event will be handled by Matcher(type='message', module=src.plugins.nonebot_plugin_bertvits2, lineno=35)
12-10 20:59:39 [DEBUG] nonebot | Running Matcher(type='message', module=src.plugins.nonebot_plugin_bertvits2, lineno=35)
12-10 20:59:39 [DEBUG] nonebot | Running handler Dependent(call=_)
12-10 20:59:39 [DEBUG] nonebot | Handler Dependent(call=_) skipped
12-10 20:59:39 [INFO] nonebot | Matcher(type='message', module=src.plugins.nonebot_plugin_bertvits2, lineno=35) running complete
12-10 20:59:39 [DEBUG] nonebot | Checking for matchers completed

以下是server_fastapi.py运行的日志:

12-10 20:43:11 SUCCESS  | server_fastapi.py:99 | 添加模型D:\Program\bot\voice\Data\XingTong\models\G_8000.pth,使用配置 文件D:\Program\bot\voice\Data\XingTong\config.json
12-10 20:43:11 WARNING  | server_fastapi.py:537 | 本地服务,请勿将服务端口暴露于外网
12-10 20:43:11 INFO     | server_fastapi.py:538 | api文档地址 http://127.0.0.1:5000/docs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.