-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from TareHimself/dev
Batch processing
- Loading branch information
Showing
37 changed files
with
861 additions
and
1,077 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,5 @@ yarn-error.log* | |
manga-translator-service-account-data.json | ||
exa/* | ||
local/* | ||
trans-test/* | ||
trans-test/* | ||
*.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,108 @@ | ||
# Build ui using node | ||
FROM node:18.12.1 | ||
# FROM node:18.12.1 | ||
|
||
COPY package.json . | ||
COPY package-lock.json . | ||
COPY public public | ||
COPY src src | ||
COPY tsconfig.json . | ||
COPY .eslintrc.json . | ||
# WORKDIR /app | ||
|
||
RUN npm install | ||
# COPY ui ui | ||
|
||
RUN npm run build | ||
# WORKDIR /app/ui | ||
|
||
# RUN npm install | ||
|
||
# RUN npm run build | ||
|
||
|
||
# Use the NVIDIA CUDA base image | ||
FROM nvidia/cuda:11.7.1-runtime-ubuntu20.04 | ||
|
||
|
||
COPY --from=0 build build | ||
WORKDIR /app | ||
|
||
# COPY --from=0 /app/ui/build /ui/build | ||
# Set the working directory to /app | ||
#WORKDIR /app | ||
|
||
# Update package lists and install required packages | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
apt-get install -y python3.9 python3-pip | ||
|
||
# # Make sure Python 3.9 is the default python3 version | ||
# RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 | ||
# RUN apt-get update | ||
# RUN apt-get remove python | ||
# RUN apt-get remove python-pip | ||
# RUN apt-get -y install software-properties-common | ||
# RUN add-apt-repository ppa:deadsnakes/ppa | ||
# RUN apt-get -y install python3.9 | ||
# RUN apt-get -y install python3-pip | ||
|
||
# Create a symbolic link for pip (optional) | ||
RUN ln -s /usr/bin/pip3 /usr/bin/pip | ||
COPY translator translator | ||
COPY server.py . | ||
COPY fonts fonts | ||
COPY models models | ||
COPY requirements.txt . | ||
|
||
# # Install base utilities | ||
# RUN apt-get update \ | ||
# && apt-get install -y build-essential \ | ||
# && apt-get install -y wget \ | ||
# && apt-get clean \ | ||
# && rm -rf /var/lib/apt/lists/* | ||
|
||
# # Install miniconda | ||
# ENV CONDA_DIR /opt/conda | ||
# RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \ | ||
# /bin/bash ~/miniconda.sh -b -p /opt/conda | ||
|
||
# Verify Python and pip versions | ||
RUN python3 --version && pip --version | ||
# # Put conda in path so we can use conda activate | ||
# ENV PATH=$CONDA_DIR/bin:$PATH | ||
|
||
# # Create symbolic links to set Python 3.9 as the default | ||
# RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 && \ | ||
# update-alternatives --config python3 | ||
# RUN apt-get update && apt-get install -y python3.9 python3.9-dev | ||
# RUN conda create -n translator python=3.9 -y | ||
|
||
COPY translator translator | ||
COPY server.py . | ||
COPY fonts fonts | ||
COPY models models | ||
COPY requirements.txt . | ||
# SHELL ["conda", "run", "-n", "translator", "/bin/bash", "-c"] | ||
|
||
# RUN pip install -r requirements.txt | ||
# RUN pip uninstall -y torch torchvision torchaudio | ||
# RUN pip install opencv-python | ||
# RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117 | ||
|
||
# RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
# software-properties-common \ | ||
# libsm6 libxext6 ffmpeg libfontconfig1 libxrender1 libgl1-mesa-glx \ | ||
# curl python3-pip | ||
|
||
# RUN pip3 install --upgrade pip | ||
|
||
# RUN pip3 install -r requirements.txt | ||
# RUN pip3 uninstall -y torch torchvision torchaudio | ||
# RUN pip3 install opencv-python | ||
# RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117 | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
software-properties-common \ | ||
libsm6 libxext6 ffmpeg libfontconfig1 libxrender1 libgl1-mesa-glx \ | ||
curl python3-pip | ||
|
||
RUN curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o ~/miniconda.sh \ | ||
&& sh ~/miniconda.sh -b -p /opt/conda \ | ||
&& rm ~/miniconda.sh | ||
|
||
ENV PATH /opt/conda/bin:$PATH | ||
|
||
RUN conda update -n base -c defaults conda | ||
|
||
COPY conda.yml conda.yml | ||
|
||
RUN conda env create -f conda.yml --name translator | ||
|
||
RUN conda activate translator | ||
|
||
RUN pip install -r requirements.txt | ||
# RUN python3.9 -m pip install -r requirements.txt | ||
|
||
RUN pip uninstall -y torch torchvision torchaudio | ||
# RUN python3.9 -m | ||
|
||
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117 | ||
# RUN python3.9 -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117 | ||
|
||
CMD ["python","server.py"] | ||
CMD ["python3","server.py"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.