This project is a real-time Text-to-Speech (TTS) assistant powered by OpenAI's GPT-3 model and a local inference server. It converts text input into speech output as you type, making it an interactive and hands-free tool.
Before you begin, ensure you have the following:
- Python 3.x
- Required Python packages (install via
pip
):openai
pyttsx3
nltk
- LM Studio
-
Clone this repository:
git clone https://github.com/your-username/Realtime-TTS-Assistant.git](https://github.com/ProjCRys/Realtime-TTS-Assisstant.git cd Realtime-TTS-Assistant
-
Configure OpenAI API settings or you can use local host for local language models in the script:
- Set the API base and key in the script:
openai.api_base = 'http://localhost:1234/v1' # Update with your API endpoint openai.api_key = 'YOUR_API_KEY' # Replace with your API key or simply leave it empty for local language models
-
Create a
context.txt
file and provide system prompt for the assistant. -
Customize prompt format by modifying the
prefix
andsuffix
variables as needed. -
Run the script:
python lmStudio_to_TTS.py
-
Run the script and interact with the assistant in your terminal. Type your input, and the assistant will respond with speech output in real-time.
-
To exit the program, type 'exit' and press Enter.
- Real-time text-to-speech conversion.
- Customizable prompt format.
- Sentence-based TTS for natural conversation flow.
https://m.youtube.com/watch?v=TrOsG4jnSNw&t=5s
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for the GPT-3 model.
- Python community and open-source contributors.
- LM Studio for Local Server Inference