Browse Source

feat (demo): add dockerfile for demo

Rongxin 1 year ago
parent
commit
47ee968264
3 changed files with 32 additions and 0 deletions
  1. 20 0
      Dockerfile.Demo
  2. 6 0
      README.md
  3. 6 0
      README_zh-CN.md

+ 20 - 0
Dockerfile.Demo

@@ -0,0 +1,20 @@
+FROM python:3.12
+
+WORKDIR /app
+
+ENV PYTHONUNBUFFERED=1
+
+RUN apt-get update && apt-get install -y libgl1 \
+    && rm -rf /var/lib/apt/lists/*
+
+RUN pip install pdf2zh
+RUN mkdir -p /data
+RUN chmod 777 /data
+RUN mkdir -p /app
+RUN chmod 777 /app
+RUN mkdir -p /.cache
+RUN chmod 777 /.cache
+RUN mkdir -p ./gradio_files
+RUN chmod 777 ./gradio_files
+
+CMD ["pdf2zh", "-i"]

+ 6 - 0
README.md

@@ -31,11 +31,17 @@ Feel free to provide feedback in [GitHub Issues](https://github.com/Byaidu/PDFMa
 
 <h2 id="updates">Updates</h2>
 
+- [Nov. 20 2024] 🌟 [Demo](#demo)  online!
 - [Nov. 20 2024] Supports [Docker](#docker)  
 - [Nov. 20 2024] Supports [multiple-threads translation](#threads)
 - [Nov. 19 2024] Provides an [interactive graphical user interface](#gui)
 - [Nov. 18 2024] Supports [more services: DeepL, DeepLX, and Azure](#services)
 
+<h2 id="demo">Demo 🌟</h2>
+
+You can try [our demo on HuggingFace](https://huggingface.co/spaces/reycn/PDFMathTranslate-Docker) without installation.  
+Note that the computing resources of the demo are limited, so please avoid abusing them.
+
 <h2 id="install">Installation and Usage</h2>
 
 We provide three methods for using this project: [commanline](#cmd), [GUI](#gui), and [Docker](#docker).

+ 6 - 0
README_zh-CN.md

@@ -31,11 +31,17 @@
 
 <h2 id="updates">近期更新</h2>
 
+- [Nov. 20 2024] 🌟 提供了 [在线演示](#demo)!
 - [Nov. 20 2024] 支持 [容器化部署](#docker)
 - [Nov. 20 2024] 支持速度更快的 [多线程翻译](#threads)
 - [Nov. 19 2024] 提供了[图形用户界面](#gui)
 - [Nov. 18 2024] 支持更多翻译服务,包含 [DeepL, DeepLX, 和 Azure](#services)
 
+<h2 id="demo">在线演示 🌟</h2>
+
+你可以立即尝试 [在 HuggingFace 上的在线演示](https://huggingface.co/spaces/reycn/PDFMathTranslate-Docker) 而无需安装.  
+请注意,演示的计算资源有限,因此请避免滥用。
+
 <h2 id="install">安装和使用</h2>
 
 我们提供了三种使用该项目的方法:[命令行工具](#cmd)、[图形交互界面](#gui) 和 [容器化部署](#docker).