-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69322f7
commit 57b49fe
Showing
3 changed files
with
123 additions
and
7 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
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker | ||
# you will also find guides on how best to write your Dockerfile | ||
|
||
FROM python:3.9 | ||
|
||
WORKDIR /code | ||
|
||
COPY ./requirements.txt /code/requirements.txt | ||
|
||
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | ||
|
||
RUN wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb | ||
RUN dpkg -i packages-microsoft-prod.deb | ||
RUN rm packages-microsoft-prod.deb | ||
|
||
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y dotnet-sdk-7.0 | ||
RUN apt-get install -y aspnetcore-runtime-7.0 | ||
RUN apt-get install -y cmake | ||
RUN apt-get install -y git-lfs | ||
|
||
RUN git clone https://github.com/zhongkaifu/Seq2SeqSharp.git | ||
WORKDIR /code/Seq2SeqSharp | ||
RUN dotnet build Seq2SeqSharp.sln --configuration Release | ||
|
||
WORKDIR /code/Seq2SeqSharp/ExternalProjects | ||
RUN unzip SentencePiece.zip | ||
WORKDIR /code/Seq2SeqSharp/ExternalProjects/SentencePiece | ||
RUN mkdir build | ||
WORKDIR /code/Seq2SeqSharp/ExternalProjects/SentencePiece/build | ||
RUN cmake .. | ||
RUN make -j $(nproc) | ||
RUN make install | ||
RUN ldconfig -v | ||
|
||
WORKDIR /code | ||
|
||
#RUN git clone https://huggingface.co/zhongkaifu/mt_enu_chs | ||
|
||
RUN mkdir -p /code/bin | ||
RUN chmod 777 /code/bin | ||
WORKDIR /code/bin | ||
|
||
RUN cp -r /code/Seq2SeqSharp/Tools/SeqWebApps/bin/Release/net7.0/* . | ||
RUN wget https://huggingface.co/zhongkaifu/mt_enu_chs/resolve/main/mt_enu_chs.model | ||
RUN wget https://huggingface.co/zhongkaifu/mt_enu_chs/resolve/main/chsSpm.model | ||
RUN rm appsettings.json | ||
RUN wget https://huggingface.co/zhongkaifu/mt_enu_chs/resolve/main/appsettings.json | ||
#RUN cp /code/mt_enu_chs/appsettings.json . | ||
|
||
CMD ["dotnet","/code/bin/SeqWebApps.dll"] |
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker | ||
# you will also find guides on how best to write your Dockerfile | ||
|
||
FROM nvidia/cuda:12.3.0-base-ubuntu22.04 | ||
|
||
WORKDIR /code | ||
|
||
RUN apt-get update | ||
RUN apt install -y zip | ||
|
||
# Install .NET SDK | ||
RUN apt-get update | ||
RUN apt-get install -y dotnet-sdk-7.0 | ||
RUN apt-get install -y aspnetcore-runtime-7.0 | ||
RUN apt-get install -y cmake | ||
RUN apt-get install -y git-lfs | ||
|
||
RUN cat /etc/os-release | ||
RUN apt-get install -y software-properties-common | ||
|
||
# Install Cuda | ||
RUN apt install wget | ||
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb | ||
RUN dpkg -i cuda-keyring_1.1-1_all.deb | ||
RUN apt-get update | ||
RUN apt-get -y install cuda-toolkit-12-3 | ||
|
||
# Clone Seq2SeqSharp | ||
RUN git clone https://github.com/zhongkaifu/Seq2SeqSharp.git | ||
WORKDIR /code/Seq2SeqSharp | ||
RUN dotnet build Seq2SeqSharp.sln --configuration Release | ||
|
||
RUN apt-get install -y build-essential | ||
|
||
# Build customized SentencePiece | ||
WORKDIR /code/Seq2SeqSharp/ExternalProjects | ||
RUN unzip SentencePiece.zip | ||
WORKDIR /code/Seq2SeqSharp/ExternalProjects/SentencePiece | ||
RUN mkdir build | ||
WORKDIR /code/Seq2SeqSharp/ExternalProjects/SentencePiece/build | ||
RUN cmake .. | ||
RUN make -j $(nproc) | ||
RUN make install | ||
RUN ldconfig -v | ||
|
||
WORKDIR /code | ||
|
||
RUN mkdir -p /code/bin | ||
RUN chmod 777 /code/bin | ||
WORKDIR /code/bin | ||
|
||
# Deploy models, vocabulary and config files | ||
RUN cp -r /code/Seq2SeqSharp/Tools/SeqWebApps/bin/Release/net7.0/* . | ||
RUN wget https://huggingface.co/zhongkaifu/story_writing/resolve/main/ybook_2b.model.415000 | ||
RUN wget https://huggingface.co/zhongkaifu/story_writing/resolve/main/chsSpm.model | ||
RUN wget https://huggingface.co/zhongkaifu/story_writing/resolve/main/Map_SC_TC.txt | ||
RUN rm appsettings.json | ||
RUN wget https://huggingface.co/zhongkaifu/story_writing/resolve/main/appsettings.json | ||
|
||
# ENV MKL_ENABLE_INSTRUCTIONS=AVX2 | ||
|
||
# Run application | ||
CMD ["dotnet","/code/bin/SeqWebApps.dll"] |