Spaces:
Sleeping
Sleeping
fixed dockerfile to download tikal and build fast_align
Browse files- Dockerfile +19 -8
- README.md +10 -0
- readme.md +1 -1
Dockerfile
CHANGED
@@ -4,18 +4,29 @@ WORKDIR /app
|
|
4 |
|
5 |
COPY fast_align_config ./fast_align_config
|
6 |
COPY src ./src
|
7 |
-
COPY okapi-apps_gtk2-linux-x86_64_1.47.0 ./okapi-apps_gtk2-linux-x86_64_1.47.0
|
8 |
COPY gradio_app.py .
|
9 |
COPY requirements.txt .
|
10 |
|
11 |
-
|
12 |
-
|
13 |
|
14 |
-
|
15 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
RUN
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
CMD ["python", "gradio_app.py"]
|
|
|
4 |
|
5 |
COPY fast_align_config ./fast_align_config
|
6 |
COPY src ./src
|
|
|
7 |
COPY gradio_app.py .
|
8 |
COPY requirements.txt .
|
9 |
|
10 |
+
RUN apt-get update && \
|
11 |
+
apt-get install -y libgomp1 openjdk-17-jre-headless wget unzip libgoogle-perftools-dev libsparsehash-dev git cmake build-essential
|
12 |
|
13 |
+
# download and compile fast align
|
14 |
+
RUN git clone https://github.com/clab/fast_align.git fast_align_src && \
|
15 |
+
cd fast_align_src && \
|
16 |
+
mkdir build && \
|
17 |
+
cd build && \
|
18 |
+
cmake .. && \
|
19 |
+
make
|
20 |
|
21 |
+
RUN cp fast_align_src/build/fast_align .
|
22 |
+
RUN cp fast_align_src/build/atools .
|
23 |
+
RUN rm -rf fast_align_src
|
24 |
+
|
25 |
+
# download okapi tikal
|
26 |
+
RUN wget https://okapiframework.org/binaries/main/1.47.0/okapi-apps_gtk2-linux-x86_64_1.47.0.zip
|
27 |
+
RUN unzip okapi-apps_gtk2-linux-x86_64_1.47.0.zip -d okapi-apps_gtk2-linux-x86_64_1.47.0
|
28 |
+
|
29 |
+
RUN pip install -r requirements.txt
|
30 |
+
RUN python -m spacy download xx_ent_wiki_sm
|
31 |
|
32 |
CMD ["python", "gradio_app.py"]
|
README.md
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: Document Translator
|
3 |
+
emoji: ⚡
|
4 |
+
colorFrom: pink
|
5 |
+
colorTo: purple
|
6 |
+
sdk: docker
|
7 |
+
pinned: false
|
8 |
+
---
|
9 |
+
|
10 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
readme.md
CHANGED
@@ -28,5 +28,5 @@ Class that uses huggingface's demo.
|
|
28 |
|
29 |
## Docker
|
30 |
|
31 |
-
|
32 |
docker run -p 7860:7860 -e HF_TOKEN=your_token_here --rm -it document-translator
|
|
|
28 |
|
29 |
## Docker
|
30 |
|
31 |
+
docker build -t document-translator .
|
32 |
docker run -p 7860:7860 -e HF_TOKEN=your_token_here --rm -it document-translator
|