- copy
.env.exampleto named file.env - put your openai api key in
.envvalueOPENAI_KEY - type
virtualenv venvto create new venv - type
source venv/bin/activateto activity venv - type
pip install -r requirements.txtto install requirements package - wait pip install finish
- type
python app.py - open your browser and type http://127.0.0.1:7860
- the api docs in http://127.0.0.1:7860/?view=api
To build a Docker container for the OpenAI Text To Speech API with Gradio, follow these steps:
- Make sure you have Docker installed on your system.
- Open a terminal and navigate to the project directory.
- Run the following command to build the Docker image:
docker build -t openai-tts-gradio . - Wait for the build process to complete.
- Once the build is finished, you can run the Docker container using the following command:
docker run -d --name openai-tts-gradio -p 7860:7860 -e OPENAI_KEY=<YOUR_OPENAI_KEY> -e SERVER_NAME=0.0.0.0 openai-tts-gradio - Open your browser and navigate to http://127.0.0.1:7860 to access the API.
