zach commited on
Commit
9100090
·
1 Parent(s): f420a37

Add Dockerfile and .dockerignore, update server_name arg for gradio launch

Browse files
Files changed (5) hide show
  1. .dockerignore +41 -0
  2. .gitignore +1 -1
  3. Dockerfile +24 -0
  4. README.md +4 -0
  5. src/app.py +1 -1
.dockerignore ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.pyo
5
+ *.pyd
6
+
7
+ # Virtual environment
8
+ venv/
9
+ gradio-env/
10
+ .python-version
11
+
12
+ # Distribution / Packaging
13
+ build/
14
+ dist/
15
+ *.egg-info/
16
+
17
+ # Environment variables
18
+ .env
19
+
20
+ # Logs
21
+ *.log
22
+
23
+ # IDE settings (e.g., VSCode, PyCharm)
24
+ .vscode/
25
+ .idea/
26
+ *.swp
27
+ *.swo
28
+ *.swn
29
+
30
+ # Jupyter Notebook checkpoints (if applicable)
31
+ .ipynb_checkpoints/
32
+
33
+ # System files
34
+ .DS_Store
35
+ Thumbs.db
36
+
37
+ # Python cache
38
+ *.cache
39
+
40
+ # Temp files
41
+ static/audio/*
.gitignore CHANGED
@@ -5,8 +5,8 @@ __pycache__/
5
  *.pyd
6
 
7
  # Virtual environment
 
8
  venv/
9
- gradio-env/
10
  .python-version
11
 
12
  # Distribution / Packaging
 
5
  *.pyd
6
 
7
  # Virtual environment
8
+ .venv
9
  venv/
 
10
  .python-version
11
 
12
  # Distribution / Packaging
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official Python 3.11 slim image as the base image
2
+ FROM python:3.11-slim
3
+
4
+ # Install curl (if not already present) and install uv using its standalone installer
5
+ RUN apt-get update && apt-get install -y curl && \
6
+ curl -LsSf https://astral.sh/uv/install.sh | sh && \
7
+ rm -rf /var/lib/apt/lists/*
8
+
9
+ # Set the working directory in the container
10
+ WORKDIR /app
11
+
12
+ # Copy all project files into the container
13
+ COPY . .
14
+
15
+ # Pre-sync the project’s virtual environment and install dependencies
16
+ # This command reads your pyproject.toml (and uv.lock if available) and creates a .venv with all required packages.
17
+ RUN /root/.local/bin/uv sync
18
+
19
+ # Gradio port 7860
20
+ EXPOSE 7860
21
+
22
+ # Define the command to run your application using uv.
23
+ # uv run will automatically ensure that the built-in venv is active and dependencies are up to date.
24
+ CMD ["/root/.local/bin/uv", "run", "python", "-m", "src.app"]
README.md CHANGED
@@ -7,9 +7,11 @@
7
  </div>
8
 
9
  ## Overview
 
10
  Expressive TTS Arena is an open-source web application that enables users to compare text-to-speech outputs with a focus on expressiveness rather than just audio quality. Built with [Gradio](https://www.gradio.app/), it provides a seamless interface for generating and comparing speech synthesis from different providers, including Hume AI and ElevenLabs.
11
 
12
  ## Features
 
13
  - Text generation using Claude 3.5 Sonnet by Anthropic for creating expressive content.
14
  - Direct text input or AI-assisted text generation.
15
  - Comparative analysis of different TTS outputs.
@@ -24,6 +26,7 @@ Expressive TTS Arena is an open-source web application that enables users to com
24
  - For a complete list of dependencies, see [requirements.txt](./requirements.txt).
25
 
26
  ## Project Structure
 
27
  ```
28
  Expressive TTS Arena/
29
  ├── src/
@@ -85,4 +88,5 @@ Expressive TTS Arena/
85
  4. **Vote for Your Favorite:** Click "Vote for option A" or "Vote for option B" to choose your favorite.
86
 
87
  ## License
 
88
  This project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details.
 
7
  </div>
8
 
9
  ## Overview
10
+
11
  Expressive TTS Arena is an open-source web application that enables users to compare text-to-speech outputs with a focus on expressiveness rather than just audio quality. Built with [Gradio](https://www.gradio.app/), it provides a seamless interface for generating and comparing speech synthesis from different providers, including Hume AI and ElevenLabs.
12
 
13
  ## Features
14
+
15
  - Text generation using Claude 3.5 Sonnet by Anthropic for creating expressive content.
16
  - Direct text input or AI-assisted text generation.
17
  - Comparative analysis of different TTS outputs.
 
26
  - For a complete list of dependencies, see [requirements.txt](./requirements.txt).
27
 
28
  ## Project Structure
29
+
30
  ```
31
  Expressive TTS Arena/
32
  ├── src/
 
88
  4. **Vote for Your Favorite:** Click "Vote for option A" or "Vote for option B" to choose your favorite.
89
 
90
  ## License
91
+
92
  This project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details.
src/app.py CHANGED
@@ -544,4 +544,4 @@ def build_gradio_interface() -> gr.Blocks:
544
  if __name__ == "__main__":
545
  logger.info("Launching TTS Arena Gradio app...")
546
  demo = build_gradio_interface()
547
- demo.launch(allowed_paths=[AUDIO_DIR])
 
544
  if __name__ == "__main__":
545
  logger.info("Launching TTS Arena Gradio app...")
546
  demo = build_gradio_interface()
547
+ demo.launch(server_name="0.0.0.0", allowed_paths=[AUDIO_DIR])