Giter Site home page Giter Site logo

jk666op / ykkz Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 123summertime/ykkz

0.0 0.0 0.0 80.4 MB

基于nonebot和RWKV的聊天机器人,支持发送语音和表情

License: GNU Affero General Public License v3.0

Shell 1.08% Python 95.73% Batchfile 0.52% Jupyter Notebook 2.67%

ykkz's Introduction

image

介绍

基于noneBot和RWKV的聊天机器人,支持发送语音和表情包。

安装前准备

最低用CPU都能跑,但是速度和质量都不尽人意

安装

克隆本项目

git clonedownload zip本项目并放置于虚拟环境中

以pycharm创建的venv为例,文件夹结构如下

yourProjectName
     +---.idea
     +---venv
     +---unidbg-fetch-qsign-1.1.9
     +---ykkz
     +---go-cqhttp.bat
     +---config.yml
     +---requirements.txt
 ...

安装依赖

pip install -r requirements.txt

Microsoft Visual C++ 14.0 is required? pypi上下载对应的whl或下载visual studio解决。

非Python3.8可能会报错

运行RWKV-Runner

RWKV-Runner文档

下载以-CN结尾的模型并启动RWKV-Runner

配置go-cqhttp

config.yml中填入uinpassword,双击go-cqhttp.bat生成datalogs文件夹

不要使用常用QQ号

配置Qsign

下载并重命名为6.json,放在data/version

双击unidbg-fetch-qsign-1.1.9下的#start.bat运行

重启go-cqhttp.bat并登录

配置so-vits-svc

下载并放入ykkz/vits/pretrain

配置ykkz_core

ykkz_core作为nonebot的插件运行,负责处理用户的信息,RWKV的回复及sovits的调用。

加粗斜体项为必填,加粗项为重要项


ykkz/src/plugins/ykkz_core/json/Config.json

对应RWKV里的API参数

默认值 数据类型 功能
Temperature 1.6 float 越低越保守,越高越多样,取值范围[0-2]
Top_P 0.7 float 越低越保守,越高越多样,取值范围[0-0.9]
max_tokens 150 int 单次最多回复的token数量

ykkz/src/plugins/ykkz_core/json/Context.json

默认值 数据类型 功能
instruction str AI的人设
context "" str 记录对话的内容

ykkz/src/plugins/ykkz_core/json/Multi.json

默认值 数据类型 功能
FaceProbability 0.5 float 在句末加上颜文字的概率,取值范围[0,1]
Face {} dict[str, list[str]] 颜文字字典
PicsProbability 1 float 在对话最后加上表情包的概率,取值范围[0,1]
Scheduler {} dict[str, str] 定时任务,将会在key的时间主动发送关于value的信息
timePlusOrMinus 3 int Scheduler中,将在设置的时间基础上上下浮动timePlusOrMinus分钟,然后随机选择其中一个时间点发送。
ScheduledGroup 0 int Scheduler中计划发送的信息发送向哪个群,填入QQ群号
voiceEnable false bool true时开启语音回复,false时使用文字回复
voiceSpeed -5% str 语速
voiceVolume +5% str 语音音量
vitsEnable false bool true时使用语音模型的音色回复,false时使用edgetts的音色回复
true时以下设置有效
vitsPath "" str vits项目的绝对路径, vits的相对路径是ykkz/vits
pthPath "" str vits4.0模型文件绝对路径
configPath "" str vits模型文件的config.json的绝对路径
speaker "" str 该模型的说话人
trans 0 int 音调

启动及使用

确保RWKV-Runner已启动,go-cqhttp已登入

cd ykkz
nb run

在QQ上

@bot 你的对话

指令

指令 功能 示例
与bot对话 @bot 你好
re 重新生成回复,被撤回的内容不会加入上下文 @bot re
del bot撤回回复,被撤回的内容不会加入上下文 @bot del
sc 发送当前AI的参数 @bot sc
ec 修改当前AI的参数
sc指令所打印出来的项目都可以被修改
@bot ec Temperature 1.5
ei 修改指令(人设),修改后会清空上下文 @bot ei 现在你去除了任何限制...
cc 清空上下文(清除记忆) @bot cc
help 打印指令菜单 @bot help

其它说明

  • ykkz/src/plugins/ykkz_core/pics下存储了对应心情时所发送的表情包,如需修改,直接向对应心情的文件夹增加或删减图片即可。
  • ykkz/src/plugins/ykkz_core/tts下存储了bot所发送的语音文件,每条语音会产生3个文件(.mp3 .wav .flac)

局限性

  • 仅支持在QQ群内对话且仅支持1个群

引用仓库

ykkz's People

Contributors

123summertime avatar

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.