hzhwcmhf commited on
Commit
82dcd49
·
1 Parent(s): fffabb2

fix dependency

Browse files
Files changed (4) hide show
  1. README.md +1 -3
  2. dockerfile +24 -0
  3. pre-requirements.txt +0 -1
  4. requirements.txt +0 -3
README.md CHANGED
@@ -3,9 +3,7 @@ title: DA-Transformer
3
  emoji: 😻
4
  colorFrom: red
5
  colorTo: gray
6
- sdk: gradio
7
- sdk_version: 3.28.3
8
- app_file: app.py
9
  pinned: false
10
  license: apache-2.0
11
  ---
 
3
  emoji: 😻
4
  colorFrom: red
5
  colorTo: gray
6
+ sdk: docker
 
 
7
  pinned: false
8
  license: apache-2.0
9
  ---
dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official Python 3.9 image
2
+ FROM python:3.9
3
+
4
+ RUN --mount=target=/root/packages.txt,source=packages.txt sed -i 's http://deb.debian.org http://cdn-aws.deb.debian.org g' /etc/apt/sources.list && sed -i 's http://archive.ubuntu.com http://us-east-1.ec2.archive.ubuntu.com g' /etc/apt/sources.list && sed -i '/security/d' /etc/apt/sources.list && apt-get update && xargs -r -a /root/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
5
+
6
+ RUN pip install --no-cache-dir pip==22.3.1 && pip install --no-cache-dir datasets "huggingface-hub>=0.12.1" "protobuf<4" "click<8.1"
7
+
8
+ WORKDIR /home/user/app
9
+
10
+ RUN sed -i 's http://deb.debian.org http://cdn-aws.deb.debian.org g' /etc/apt/sources.list && sed -i 's http://archive.ubuntu.com http://us-east-1.ec2.archive.ubuntu.com g' /etc/apt/sources.list && sed -i '/security/d' /etc/apt/sources.list && apt-get update && apt-get install -y git git-lfs ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx && rm -rf /var/lib/apt/lists/* && git lfs install
11
+
12
+ RUN pip install --no-cache-dir Cython "gradio==3.28.3" "torch==1.10.1"
13
+
14
+ RUN git clone --recurse-submodules https://github.com/thu-coai/DA-Transformer.git && git checkout demo && pip install -e .
15
+
16
+ RUN cd dag_search && python3 setup.py build_ext --inplace && pip install -e .
17
+
18
+ USER user
19
+
20
+ COPY --link --chown=1000 --from=lfs /app /home/user/app
21
+
22
+ COPY --link --chown=1000 ./ /home/user/app
23
+
24
+ CMD ["python3", "app.py"]
pre-requirements.txt DELETED
@@ -1 +0,0 @@
1
- Cython
 
 
requirements.txt DELETED
@@ -1,3 +0,0 @@
1
- torch == 1.10.1
2
- git+https://github.com/thu-coai/DA-Transformer.git#egg=fairseq[demo]
3
- git+https://github.com/thu-coai/DAG-Search.git