Spaces:
Sleeping
Sleeping
Upload 2 files (#1)
Browse files- Upload 2 files (87f185893db8937323fe115181980bda9e75c5a8)
- Dockerfile +28 -0
- README.md +0 -5
Dockerfile
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.12
|
2 |
+
|
3 |
+
WORKDIR /app
|
4 |
+
|
5 |
+
ENV PYTHONUNBUFFERED=1
|
6 |
+
|
7 |
+
RUN apt-get update && apt-get install -y libgl1 \
|
8 |
+
&& rm -rf /var/lib/apt/lists/*
|
9 |
+
|
10 |
+
RUN pip install pdf2zh
|
11 |
+
RUN mkdir -p /data
|
12 |
+
RUN chmod 777 /data
|
13 |
+
RUN mkdir -p /app
|
14 |
+
RUN chmod 777 /app
|
15 |
+
RUN mkdir -p /.cache
|
16 |
+
RUN chmod 777 /.cache
|
17 |
+
RUN mkdir -p ./gradio_files
|
18 |
+
RUN chmod 777 ./gradio_files
|
19 |
+
RUN mkdir -p /.config
|
20 |
+
RUN chmod 777 /.config
|
21 |
+
RUN mkdir -p /.config/PDFMathTranslate
|
22 |
+
RUN chmod 777 /.config/PDFMathTranslate
|
23 |
+
|
24 |
+
|
25 |
+
# write several lines to the file /.config/PDFMathTranslate/config.json
|
26 |
+
RUN echo '{ "USE_MODELSCOPE": "0", "PDF2ZH_LANG_FROM": "English", "PDF2ZH_LANG_TO": "Simplified Chinese", "NOTO_FONT_PATH": "/app/SourceHanSerifCN-Regular.ttf", "translators":[]}' > /.config/PDFMathTranslate/config.json
|
27 |
+
RUN chmod 777 /.config/PDFMathTranslate/config.json
|
28 |
+
CMD ["pdf2zh", "-i", "--config", "/.config/PDFMathTranslate/config.json"]
|
README.md
CHANGED
@@ -1,11 +1,6 @@
|
|
1 |
---
|
2 |
title: PDF2ZH
|
3 |
-
emoji: 👀
|
4 |
-
colorFrom: green
|
5 |
-
colorTo: purple
|
6 |
sdk: docker
|
7 |
pinned: false
|
8 |
license: gpl-3.0
|
9 |
---
|
10 |
-
|
11 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
title: PDF2ZH
|
|
|
|
|
|
|
3 |
sdk: docker
|
4 |
pinned: false
|
5 |
license: gpl-3.0
|
6 |
---
|
|
|
|