Git Product home page Git Product logo

ai-yinmei's Introduction

AI-YinMei

  • AI 虚拟主播 Vtuber 研发(N 卡版本)
  • AI 名称:吟美
  • 开发者:Winlone
  • B 站频道:程序猿的退休生活
  • Q 群:27831318
  • 版本:1.0
  • 详细笔记:https://note.youdao.com/s/1k0x7BLt

介绍

  • 支持本地 LLM 模型 chatglm-6b 的 1 代~3 代的 AI 自然语言回复
  • 支持对接 bilibili 直播间弹幕回复和进入直播间欢迎语
  • 支持微软 edge-tts 语音合成
  • 支持聊天记忆模式和扮演卡,可以多角色切换
  • 支持 AI 训练 LLaMA-Factory
  • 支持表情控制 Vtuber Studio
  • 支持绘画 stable-diffusion-webui 输出 OBS 直播间
  • 支持绘画图片鉴黄 public-NSFW-y-distinguish
  • 支持搜索和搜图服务 duckduckgo

运行环境

  • Python 3.11.6

调用类库

  • 对应重要的 py 包
    torch:2.1.0+cu121
    peft:0.6.2
    bilibili-api-python:16.1.1
    edge-tts:6.1.9
    pynput:1.7.6
    APScheduler:3.10.4
    transformers:4.35.2
    websocket-client:1.6.4v
    duckduckgo_search:4.1.1
    pyvirtualcam:0.11.0
    opencv-python:4.8.1.78
    Flask:3.0.0
    Flask-APScheduler:1.13.1
    duckduckgo_search:4.1.1

启动方式

1、(必选)启动应用层,在根目录

#进入虚拟环境
& 盘符:路径/pylib/aivenv/Scripts/Activate.ps1
#安装py包
pip install -r requirements.txt
#启动对接b站直播程序
#一:1.b站直播间 2.api web 3.双开:
#二:0.对接后端text-generation-webui接口   1.当前加载LLM本地模型
#三:输入你的B站直播间编号
python bilibili-live-api.py

修改内容须知:

B 站直播间鉴权(B 站浏览器获取 cookie):sessdata、buvid3
Vtuber Studio 表情 ws 地址:ws = websocket.WebSocketApp("ws://127.0.0.1:8001",on_open = on_open)
唱歌服务 Auto-Convert-Music 地址:singUrl = "192.168.2.58:1717"
绘画服务 stable-diffusion-webui 地址:drawUrl = "192.168.2.58:7860"
聊天服务 text-generation-webui 地址:tgwUrl = "192.168.2.58:5000"
LLM 模型路径:model_path = "ChatGLM2/THUDM/chatglm2-6b"
LLM 训练模型路径:checkpoint_path = ("LLaMA-Factory/saves/ChatGLM2-6B-Chat/lora/yinmei-20231123-ok-last")
搜索服务代理:duckduckgo_proxies="socks5://127.0.0.1:10806"
搜图服务代理:proxies = {"http": "socks5://127.0.0.1:10806", "https": "socks5://127.0.0.1:10806"}

2、(可选)启动 LLM 聊天服务 text-generation-webui
项目 github:https://github.com/oobabooga/text-generation-webui

#进入虚拟环境
& 盘符:py虚拟空间路径/Scripts/Activate.ps1
#安装py包
pip install -r requirements.txt
#启动text-generation-webui程序,start.bat是我自定义的window启动脚本
./start.bat

3、(可选)启动绘画服务 stable-diffusion-webui
项目 github:https://github.com/AUTOMATIC1111/stable-diffusion-webui

#进入虚拟环境
& 盘符:py虚拟空间路径/Scripts/Activate.ps1
#安装py包
pip install -r requirements.txt
#配置api服务webui-user.bat
@echo off
set PYTHON=.\pydraw\Scripts\python.exe
set GIT=
set VENV_DIR=.\pydraw\
set COMMANDLINE_ARGS=--api
call webui.bat
#启动text-generation-webui程序,start.bat是我自定义的window启动脚本
./webui-user.bat

4、(可选)启动绘画鉴黄服务 public-NSFW-y-distinguish
项目 github:https://github.com/fd-freedom/public-NSFW-y-distinguish

运行环境(必要):Python 3.6.13
pip install -r requirements.txt
# 此文件为本人特制
py nsfw_web.py

5、(可选)启动唱歌服务 Auto-Convert-Music
服务暂不开源

6、(必选)皮肤启动,安装 steam,安装 VTube Studio
这个自行下载 steam 平台,在平台里面有一个 VTube Studio 软件,它就是启动 live2D 的虚拟主播皮肤

7、(必选)其他
安装虚拟声卡:虚拟声卡驱动(Virtual Audio Cable)4.66 官方版

此外,需要在 text-generation-webui/models 路径放入 LLM 模型,我这里放的是 chatgml2 的模型,大家可以任意选择底层 LLM 模型,例如,千问、百川、chatglm、llama 等
更多详细技术细节,请看技术文档:https://note.youdao.com/s/1k0x7BLt

目录说明

  • text-generation-webui【第三方工具】:
    LLM 聚合接口,可以放置 chatglm 等大语言模型,然后进行参数配置后,再输入角色卡进行角色扮演聊天
    https://github.com/oobabooga/text-generation-webui
  • LLaMA-Factory【AI 训练】:
    AI 聚合训练工具,可以界面化配置训练参数,可视化 ai 训练,相当强大
    https://github.com/hiyouga/LLaMA-Factory
  • ChatGLM、ChatGLM2、ChatGLM3【语言模型】:
    放置的是清华大学研发的自然语言模型,可以自行添加如:百川、千问、LLAMA 等其他大语言模型
  • SillyTavern【第三方工具】:
    酒馆,强大的 AI 角色扮演,但是该项目没有公开接口调用,而且 TTS 语言合成很缓慢,暂未集成使用
    https://github.com/SillyTavern/SillyTavern
  • output【输出路径】:
    输出的文本 txt、语音 mp3 文件都在这里
    3
  • ChatGLM2\ptuning【AI 训练】:
    ChatGLM 官方训练例子
  • ChatGLM2\ptuning\zero_nlp【AI 训练】:
    ai 的 lora 训练模式

特别鸣谢

更多关注

  • 讨论 Q 群:27831318

ai-yinmei's People

Contributors

worm128 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.