Fancellu commited on
Commit
20b4d05
·
verified ·
1 Parent(s): fd5f95c

Upload 6 files

Browse files

Adding Docker artifacts

Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies for librosa
6
+ RUN apt-get update && apt-get install -y \
7
+ libsndfile1 \
8
+ ffmpeg \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Copy requirements and install Python dependencies
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # Copy application code
16
+ COPY . .
17
+
18
+ # Expose the port Gradio will run on
19
+ EXPOSE 7860
20
+
21
+ # Set Gradio to bind to all interfaces in Docker
22
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
23
+
24
+ # Command to run the application
25
+ CMD ["python", "app.py"]
Dockerfile.minimal ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ libsndfile1 \
6
+ ffmpeg \
7
+ && apt-get clean \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ WORKDIR /app
11
+
12
+ # Install CPU-only version of PyTorch to reduce size
13
+ COPY requirements.txt .
14
+ RUN pip install --no-cache-dir librosa piano_transcription_inference gradio>=3.50.2 huggingface_hub \
15
+ && pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
16
+
17
+ # Copy application code
18
+ COPY . .
19
+
20
+ # Expose the port Gradio will run on
21
+ EXPOSE 7860
22
+
23
+ # Set Gradio to bind to all interfaces in Docker
24
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
25
+
26
+ # Command to run the application
27
+ CMD ["python", "app.py"]
run_docker.bat ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ @echo off
2
+ REM Build the Docker image
3
+ docker build -t piano-transcription .
4
+
5
+ REM Run the container
6
+ docker run --gpus=all -p 127.0.0.1:7860:7860 piano-transcription
run_docker.sh ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # Build the Docker image
3
+ docker build -t piano-transcription .
4
+
5
+ # Run the container
6
+ docker run --gpus=all -p 127.0.0.1:7860:7860 piano-transcription
run_docker_minimal.bat ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ @echo off
2
+ REM Build the Docker image with minimal size
3
+ docker build -t piano-transcription-minimal -f Dockerfile.minimal .
4
+
5
+ REM Run the container
6
+ docker run -p 127.0.0.1:7860:7860 piano-transcription-minimal
run_docker_minimal.sh ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # Build the Docker image with minimal size
3
+ docker build -t piano-transcription-minimal -f Dockerfile.minimal .
4
+
5
+ # Run the container
6
+ docker run -p 127.0.0.1:7860:7860 piano-transcription-minimal