- copy
.env.example
to named file.env
- put your openai api key in
.env
valueOPENAI_KEY
- type
virtualenv venv
to create new venv - type
source venv/bin/activate
to activity venv - type
pip install -r requirements.txt
to 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.