This project for making a demo based on ChatGPT and speech interfaces via streamlit.
- Docs of ChatGPT and Whisper API : OpenAI Documentation
- Workflow of demo
- Recording audio
- STT (Speech-to-text) with Whisper API
- Get an answer from ChatGPT API
- (optional) Making an audio from ChatGPT's answer
-
Environment
- python 3.10
- GPU : cuda 11.6, RTX Titan
- OS : ubuntu20.04 - wsl2
- IDE : VSCode
-
OpenAI API
- You must get a secrey key of OpenAI platform from This Page.
-
Install and run
# with virtualenv $ virtualenv .venv $ . .venv/bin/activate # openai - chatgpt, whisper only $ pip install . # openai with simple TTS (with cpu version of pytorch) $ pip install .[tts] --extra-index-url https://download.pytorch.org/whl/cpu # run streamlit - with environment variable of API KEY $ OPENAI_API_KEY=[YOUR-API-KEY] streamlit run chatgpt_streamlit/app.py