Spaces:
Sleeping
Sleeping
zhongkaifu
commited on
Commit
·
6376e0d
1
Parent(s):
aaa4e10
Create Dockerfile
Browse files- Dockerfile +51 -0
Dockerfile
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
2 |
+
# you will also find guides on how best to write your Dockerfile
|
3 |
+
|
4 |
+
FROM python:3.9
|
5 |
+
|
6 |
+
WORKDIR /code
|
7 |
+
|
8 |
+
COPY ./requirements.txt /code/requirements.txt
|
9 |
+
|
10 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
11 |
+
|
12 |
+
RUN wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
|
13 |
+
RUN dpkg -i packages-microsoft-prod.deb
|
14 |
+
RUN rm packages-microsoft-prod.deb
|
15 |
+
|
16 |
+
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh
|
17 |
+
|
18 |
+
RUN apt-get update
|
19 |
+
RUN apt-get install -y dotnet-sdk-7.0
|
20 |
+
RUN apt-get install -y aspnetcore-runtime-7.0
|
21 |
+
RUN apt-get install -y cmake
|
22 |
+
RUN apt-get install -y git-lfs
|
23 |
+
|
24 |
+
RUN git clone https://github.com/zhongkaifu/Seq2SeqSharp.git
|
25 |
+
WORKDIR /code/Seq2SeqSharp
|
26 |
+
RUN dotnet build Seq2SeqSharp.sln --configuration Release
|
27 |
+
|
28 |
+
WORKDIR /code/Seq2SeqSharp/ExternalProjects
|
29 |
+
RUN unzip SentencePiece.zip
|
30 |
+
WORKDIR /code/Seq2SeqSharp/ExternalProjects/SentencePiece
|
31 |
+
RUN mkdir build
|
32 |
+
WORKDIR /code/Seq2SeqSharp/ExternalProjects/SentencePiece/build
|
33 |
+
RUN cmake ..
|
34 |
+
RUN make -j $(nproc)
|
35 |
+
RUN make install
|
36 |
+
RUN ldconfig -v
|
37 |
+
|
38 |
+
WORKDIR /code
|
39 |
+
|
40 |
+
RUN mkdir -p /code/bin
|
41 |
+
RUN chmod 777 /code/bin
|
42 |
+
WORKDIR /code/bin
|
43 |
+
|
44 |
+
RUN cp -r /code/Seq2SeqSharp/Tools/SeqWebApps/bin/Release/net7.0/* .
|
45 |
+
RUN wget https://github.com/zhongkaifu/Models/releases/download/MT_ENU_CHS/mt_chs_enu.model
|
46 |
+
RUN wget https://huggingface.co/zhongkaifu/mt_chs_enu/resolve/main/enuSpm.model
|
47 |
+
RUN wget https://huggingface.co/zhongkaifu/mt_chs_enu/resolve/main/cjkSpm.model
|
48 |
+
RUN rm appsettings.json
|
49 |
+
RUN wget https://huggingface.co/zhongkaifu/mt_chs_enu/resolve/main/appsettings.json
|
50 |
+
|
51 |
+
CMD ["dotnet","/code/bin/SeqWebApps.dll"]
|