Code Monkey home page Code Monkey logo

local_llm_bot's Introduction

Voice Agent Use Local LLM and TTS

Youtube Demo Here! ⇩

mafuyu_Voice.mp4

Japanese Demo Her! ⇩

Final.mp4

Introduction

This is a sample project to demonstrate how to use local LLM and TTS in Voice Agent. Using rinna/japanese-gpt-neox-3.6b-instruction-sft as LLM and Style-Bert-Vits-2 as TTS.

Installation

1. Clone the repository

git clone https://github.com/teftef6220/Local_LLM_bot.git
cd Local_LLM_bot

2. Make Venv

python -m venv venv
source venv/bin/activate

3. Install requirements

Install pytorch and torchaudio and torchvision from official website

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

Install cudnn from official website

Install another requirements

pip install -r requirements.txt

4. Fine-tune LLM

Fine-tune LLM with your data.

Use Colab notebook to fine-tune LLM. You can use this notebook.

this notebook

You can use

as a pretrained model.

5. Fine-tune TTS

Fine-tune TTS with your data. You can use Style-Bert-Vits-2 as a pretrained model.

Open In Colab

6. Set up Voice Agent

Put your fine-tuned LLM dir in llm_models directory

llm_models
    |
    |---model_instance_dir
        |
        |---adapter_model.bin
        |---adapter_model.json

and put your fine-tuned TTS dir in Voice_models directory.

Voice_models
    |
    |---model_name
        |
        |---model_name_e100_s2000.safetensors
        |---config.json
        |---style_vectors.npy

7. Run Voice Agent

Set config in all_config.py

python llm_agent.py

8. Bluesky bot

Also provided a simple Bluesky bot that uses the Local LLM. You can run it with the following command.

8.1. Use Bluesky bot

you can mention the bot and the bot will reply to your mention.like

@latextex.bsky.social ねえ、名前教えてよ

set .env file as below

BS_USER_NAME = "your email address"
BS_PASSWORD = "your password"

and run the bot with the following command.

python blue_sky_bot.py

this bot can detect mentions and reply to your mentions use LLM.

Credits

License

This project is licensed under the Affero General Public License v3.0 - see the LICENSE file for details.

local_llm_bot's People

Contributors

teftef6220 avatar

Stargazers

Yuhei FUJITA avatar iwamatsu avatar  avatar tokitoki avatar redaready avatar  avatar  avatar  avatar  avatar  avatar karaage avatar tk avatar

Watchers

Kostas Georgiou avatar  avatar

Forkers

tokimwc

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.