diff --git a/Dockerfile b/Dockerfile index fcc3f8d..3070283 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,7 @@ # Use an official NVIDIA runtime with CUDA and Miniconda as a parent image -FROM nvidia/cuda:12.2.0-base-ubuntu22.04 +FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime -# Install Miniconda -RUN apt-get update && apt-get install -y wget -RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh -RUN bash ~/miniconda.sh -b -p $HOME/miniconda -ENV PATH="/root/miniconda/bin:${PATH}" -RUN conda init bash +RUN apt-get update && apt-get install ffmpeg -y # Set the working directory in the container to /app WORKDIR /app @@ -14,15 +9,7 @@ WORKDIR /app # Add the current directory contents into the container at /app ADD . /app -# Create a conda environment with the necessary packages -RUN conda create -n pvtvzhen python=3.9 - -# Make RUN commands use the new environment -SHELL ["conda", "run", "-n", "pvtvzhen", "/bin/bash", "-c"] - # Install dependencies -RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y -RUN conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia RUN pip install --upgrade pip RUN pip install -r requirements.txt @@ -32,7 +19,7 @@ EXPOSE 8080 # Define environment variable ENV FLASK_RUN_PORT 8080 ENV FLASK_APP app.py -ENV FLASK_DEBUG 1 +ENV FLASK_DEBUG 0 # Run app.py when the container launches -CMD [ "/bin/bash", "-c", "source activate pvtvzhen && python3 -m flask run --host=0.0.0.0" ] +CMD [ "/bin/bash", "-c", "python -m flask run --host=0.0.0.0" ] diff --git a/work_space.py b/work_space.py index a9722f8..edcec8d 100644 --- a/work_space.py +++ b/work_space.py @@ -492,7 +492,6 @@ def srtToVoiceEdge(logger, srtFileNameAndPath, outputDir, character="zh-CN-Xiaoy fileMp3Names = [] async def convertSrtToVoiceEdge(text, path): - print(f"Start to convert srt to voice into {path}, text: {text}") communicate = edge_tts.Communicate(text, character) await communicate.save(path)