This repository contains a Flask-based chatbot with a web interface and API. The application supports conversational interactions, text-to-speech (TTS), and dynamic reloading of configurations, such as model settings and embedding modifications.
Clone the repository:
git clone https://github.com/zackrack/adaptivechatbot
cd adaptivechatbot
(Recommended) Use a Python virtual environment:
python3 -m venv venv
source venv/bin/activate
Install the required Python packages:
pip install -r requirements.txt
Set up environment variables:
CUDA_VISIBLE_DEVICES if using a machine with multiple GPUs to only use one GPU:
export CUDA_VISIBLE_DEVICES=0
(Optional, Configure your models and embeddings in config.json.
Start the Flask application:
python app.py
Access the chatbot:
http://localhost:55556/ in your web browser to chat with the assistant via the web interface.Interact via API:
This endpoint processes user input and returns a chatbot response, optionally generating an audio response using TTS.
/chatPOSTmessage (string): The user's input to the chatbot.message (string): The assistant's response.audio_url (string): A URL to the generated audio file (if TTS is enabled).curl -X POST http://localhost:55556/chat -H "Content-Type: application/json" -d '{"message": "Hello!"}'
The Praat application must be installed on your system. Update the praat_executable path in audio.py accordingly. Depending on your situation, you may need to build Praat from source.
Note that you should install praat in a separate location that is not this repository since the folder holding the scripts here is also named 'praat.' Alternatively, you can rename the folder in this repository.
git clone https://github.com/praat/praat.git
conda install cmake gcc gxx gtk3 alsa-lib -c conda-forge
cd praat
mkdir build
cd build
cmake ..
make -j$(nproc)
Make sure FFmpeg is installed on your system. You can install it using apt (Linux), brew (macOS), or from the FFmpeg official website.
29 commits
18 commits
Jupyter Notebook
50.2%
Python
46.1%
HTML
3.8%
This repository contains a Flask-based chatbot with a web interface and API. The application supports conversational interactions, text-to-speech (TTS), and dynamic reloading of configurations, such as model settings and embedding modifications.
Clone the repository:
git clone https://github.com/zackrack/adaptivechatbot
cd adaptivechatbot
(Recommended) Use a Python virtual environment:
python3 -m venv venv
source venv/bin/activate
Install the required Python packages:
pip install -r requirements.txt
Set up environment variables:
CUDA_VISIBLE_DEVICES if using a machine with multiple GPUs to only use one GPU:
export CUDA_VISIBLE_DEVICES=0
(Optional, Configure your models and embeddings in config.json.
Start the Flask application:
python app.py
Access the chatbot:
http://localhost:55556/ in your web browser to chat with the assistant via the web interface.Interact via API:
This endpoint processes user input and returns a chatbot response, optionally generating an audio response using TTS.
/chatPOSTmessage (string): The user's input to the chatbot.message (string): The assistant's response.audio_url (string): A URL to the generated audio file (if TTS is enabled).curl -X POST http://localhost:55556/chat -H "Content-Type: application/json" -d '{"message": "Hello!"}'
The Praat application must be installed on your system. Update the praat_executable path in audio.py accordingly. Depending on your situation, you may need to build Praat from source.
Note that you should install praat in a separate location that is not this repository since the folder holding the scripts here is also named 'praat.' Alternatively, you can rename the folder in this repository.
git clone https://github.com/praat/praat.git
conda install cmake gcc gxx gtk3 alsa-lib -c conda-forge
cd praat
mkdir build
cd build
cmake ..
make -j$(nproc)
Make sure FFmpeg is installed on your system. You can install it using apt (Linux), brew (macOS), or from the FFmpeg official website.
29 commits
18 commits
Jupyter Notebook
50.2%
Python
46.1%
HTML
3.8%