/talkGPT4All

A voice chatbot based on GPT4All and talkGPT, running on your local pc!

Primary LanguagePythonMIT LicenseMIT

talkGPT4All

A voice chatbot based on GPT4All and talkGPT.

Video demo.

Please check more details in this blog post (in Chinese).

Installation

Install Python Requirements

clone the code:

git clone https://github.com/vra/talkGPT4All.git <ROOT>

construct python virtual environment:

cd <ROOT>
python -m venv talkgpt4all
source talkgpt4all/bin/activate
pip install -U pip
pip install -r requirements.txt

Download Whispe model

wget https://openaipublic.azureedge.net/main/whisper/models/ed3a0b6b1c0edf879ad9b11b1af5a0e6ab5db9205f891f668f8b0e6c6326e34e/base.pt -o $HOME/.cache/whisper/base.pt

Download GPT4All checkpoint

put the downloaded model to folder <ROOT>/models.

Download GPT4All binary executable

put the downloaded executable to <ROOT>/bin.

Prepare Text to Voice program

We use pyttsx3 to convert text to voice. You can install it by running this:

pip install pyttsx3

Please note that on Linux ,You need to install dependencies:

sudo apt update && sudo apt install espeak ffmpeg libespeak1

Usage

pattern: python chat.py --platform <platform>

Mac M1:

python chat.py --platform mac-m1

Mac Intel:

python chat.py --platform mac-intel

Linux:

python chat.py --platform linux

Windows:

python chat.py --platform windows

You can choose whisper model type using --whisper-model-type <type>, all available choices:

{
"tiny.en"
"tiny"
"base.en"
"base"
"small.en"
"small"
"medium.en"
"medium"
"large-v1"
"large-v2"
"large"
}

You can tune the voice rate using --voice-rate <rate>, default rate is 165. the larger the speak faster.

e.g.,

python chat.py --platform mac-m1 --whisper-model-type large --voice-rate 150

RoadMap

  • Test code on Linux,Mac Intel and WSL2.
  • Add support for contextual information during chating.
  • Add support for Chinese input and output.
  • Add source building for llama.cpp, with more flexible interface.
  • More LLMs

contributions are welcomed!