-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Python
bilingual book maker is a Python program. It needs Python 3.10 or newer. A virtual environment keeps it apart from your other packages.
pip install -U bbook_makerThis gives you the bbook_maker command. It translates EPUB, TXT, Markdown and SRT files, and PDFs on the older text route.
The published package does not carry the PDF-to-EPUB route yet. If you want that, install from a checkout (below) and add the PDF extra.
Use a checkout if you want the newest code or the PDF-to-EPUB route.
git clone https://github.com/yihong0618/bilingual_book_maker.gitcd bilingual_book_makerpip install -r requirements.txtrequirements.txt is the pinned, tested set. pip install . also works and takes whatever versions resolve today. From a checkout the command is python make_book.py, with the same flags as bbook_maker.
If you want to turn PDFs into bilingual EPUBs (--to-epub), add the PDF extra from the same checkout. It brings docling and PyTorch; the models (about 500 MB) download on the first run, and you also need Pandoc 3.1.12 or newer.
pip install ".[pdf]"The extra reuses a PyTorch you already have instead of downloading a pinned one. That line is right on Apple silicon, on Linux with an NVIDIA GPU, and on Windows without one. Linux without an NVIDIA GPU adds PyTorch's CPU index, or it downloads about 3 GB of CUDA it cannot use; Windows with an NVIDIA GPU adds PyTorch's CUDA index. Installing the PDF extra has the line for every case.
Do not run pip install "bbook_maker[pdf]". The published package does not carry the route yet: pip only warns and installs the release without it.
If you would rather not install Python packages, use the published image. See Docker.
bbook_maker --helpFrom a checkout:
python make_book.py --helpThe help text is the authority on every flag. Command line options lists them in one table.
These pages are generated from the repository's docs/ directory (Home from README.md, 首页 from README-CN.md) by tools/docs_to_wiki.py; edit them there.
-
English
- Home
- Quick start
- Translate with an agent
- Installation
- EPUB
- Other formats
- Endpoints and models
- Evaluation
- Reference
- 中文