|
@@ -9,16 +9,18 @@ appropriate guide based on your system:
|
|
|
|
|
|
|
|
- :ref:`ubuntu_22_04_lts_section`
|
|
- :ref:`ubuntu_22_04_lts_section`
|
|
|
- :ref:`windows_10_or_11_section`
|
|
- :ref:`windows_10_or_11_section`
|
|
|
|
|
+- Quick Deployment with Docker
|
|
|
|
|
|
|
|
-- Quick Deployment with Docker > Docker requires a GPU with at least
|
|
|
|
|
- 16GB of VRAM, and all acceleration features are enabled by default.
|
|
|
|
|
|
|
+.. admonition:: Important
|
|
|
|
|
+ :class: tip
|
|
|
|
|
|
|
|
-.. note::
|
|
|
|
|
|
|
+ Docker requires a GPU with at least 16GB of VRAM, and all acceleration features are enabled by default.
|
|
|
|
|
|
|
|
- Before running this Docker, you can use the following command to
|
|
|
|
|
- check if your device supports CUDA acceleration on Docker.
|
|
|
|
|
|
|
+ Before running this Docker, you can use the following command to check if your device supports CUDA acceleration on Docker.
|
|
|
|
|
|
|
|
- bash docker run --rm --gpus=all nvidia/cuda:12.1.0-base-ubuntu22.04 nvidia-smi
|
|
|
|
|
|
|
+ .. code-block:: bash
|
|
|
|
|
+
|
|
|
|
|
+ bash docker run --rm --gpus=all nvidia/cuda:12.1.0-base-ubuntu22.04 nvidia-smi
|
|
|
|
|
|
|
|
.. code:: sh
|
|
.. code:: sh
|
|
|
|
|
|
|
@@ -42,8 +44,9 @@ Ubuntu 22.04 LTS
|
|
|
If you see information similar to the following, it means that the
|
|
If you see information similar to the following, it means that the
|
|
|
NVIDIA drivers are already installed, and you can skip Step 2.
|
|
NVIDIA drivers are already installed, and you can skip Step 2.
|
|
|
|
|
|
|
|
-Notice:``CUDA Version`` should be >= 12.1, If the displayed version
|
|
|
|
|
-number is less than 12.1, please upgrade the driver.
|
|
|
|
|
|
|
+.. note::
|
|
|
|
|
+
|
|
|
|
|
+ ``CUDA Version`` should be >= 12.1, If the displayed version number is less than 12.1, please upgrade the driver.
|
|
|
|
|
|
|
|
.. code:: text
|
|
.. code:: text
|
|
|
|
|
|
|
@@ -105,8 +108,10 @@ Specify Python version 3.10.
|
|
|
|
|
|
|
|
pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com
|
|
pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com
|
|
|
|
|
|
|
|
-❗ After installation, make sure to check the version of ``magic-pdf``
|
|
|
|
|
-using the following command:
|
|
|
|
|
|
|
+.. admonition:: Important
|
|
|
|
|
+ :class: tip
|
|
|
|
|
+
|
|
|
|
|
+ ❗ After installation, make sure to check the version of ``magic-pdf`` using the following command:
|
|
|
|
|
|
|
|
.. code:: sh
|
|
.. code:: sh
|
|
|
|
|
|
|
@@ -127,7 +132,10 @@ the script will automatically generate a ``magic-pdf.json`` file in the
|
|
|
user directory and configure the default model path. You can find the
|
|
user directory and configure the default model path. You can find the
|
|
|
``magic-pdf.json`` file in your user directory.
|
|
``magic-pdf.json`` file in your user directory.
|
|
|
|
|
|
|
|
- The user directory for Linux is “/home/username”.
|
|
|
|
|
|
|
+.. admonition:: TIP
|
|
|
|
|
+ :class: tip
|
|
|
|
|
+
|
|
|
|
|
+ The user directory for Linux is “/home/username”.
|
|
|
|
|
|
|
|
8. First Run
|
|
8. First Run
|
|
|
~~~~~~~~~~~~
|
|
~~~~~~~~~~~~
|
|
@@ -216,16 +224,16 @@ Python version must be 3.10.
|
|
|
|
|
|
|
|
pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com
|
|
pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com
|
|
|
|
|
|
|
|
-..
|
|
|
|
|
|
|
+.. admonition:: Important
|
|
|
|
|
+ :class: tip
|
|
|
|
|
|
|
|
- ❗️After installation, verify the version of ``magic-pdf``:
|
|
|
|
|
|
|
+ ❗️After installation, verify the version of ``magic-pdf``:
|
|
|
|
|
|
|
|
- .. code:: bash
|
|
|
|
|
|
|
+ .. code:: bash
|
|
|
|
|
|
|
|
magic-pdf --version
|
|
magic-pdf --version
|
|
|
|
|
|
|
|
- If the version number is less than 0.7.0, please report it in the
|
|
|
|
|
- issues section.
|
|
|
|
|
|
|
+ If the version number is less than 0.7.0, please report it in the issues section.
|
|
|
|
|
|
|
|
5. Download Models
|
|
5. Download Models
|
|
|
~~~~~~~~~~~~~~~~~~
|
|
~~~~~~~~~~~~~~~~~~
|
|
@@ -240,7 +248,10 @@ the script will automatically generate a ``magic-pdf.json`` file in the
|
|
|
user directory and configure the default model path. You can find the
|
|
user directory and configure the default model path. You can find the
|
|
|
``magic-pdf.json`` file in your 【user directory】 .
|
|
``magic-pdf.json`` file in your 【user directory】 .
|
|
|
|
|
|
|
|
- The user directory for Windows is “C:/Users/username”.
|
|
|
|
|
|
|
+.. admonition:: Tip
|
|
|
|
|
+ :class: tip
|
|
|
|
|
+
|
|
|
|
|
+ The user directory for Windows is “C:/Users/username”.
|
|
|
|
|
|
|
|
7. First Run
|
|
7. First Run
|
|
|
~~~~~~~~~~~~
|
|
~~~~~~~~~~~~
|
|
@@ -258,23 +269,23 @@ Download a sample file from the repository and test it.
|
|
|
If your graphics card has at least 8GB of VRAM, follow these steps to
|
|
If your graphics card has at least 8GB of VRAM, follow these steps to
|
|
|
test CUDA-accelerated parsing performance.
|
|
test CUDA-accelerated parsing performance.
|
|
|
|
|
|
|
|
-1. **Overwrite the installation of torch and torchvision** supporting
|
|
|
|
|
- CUDA.
|
|
|
|
|
|
|
+1. **Overwrite the installation of torch and torchvision** supporting CUDA.
|
|
|
|
|
|
|
|
- ::
|
|
|
|
|
|
|
+.. code:: sh
|
|
|
|
|
|
|
|
- pip install --force-reinstall torch==2.3.1 torchvision==0.18.1 --index-url https://download.pytorch.org/whl/cu118
|
|
|
|
|
|
|
+ pip install --force-reinstall torch==2.3.1 torchvision==0.18.1 --index-url https://download.pytorch.org/whl/cu118
|
|
|
|
|
|
|
|
- ..
|
|
|
|
|
|
|
+.. admonition:: Important
|
|
|
|
|
+ :class: tip
|
|
|
|
|
|
|
|
- ❗️Ensure the following versions are specified in the command:
|
|
|
|
|
|
|
+ ❗️Ensure the following versions are specified in the command:
|
|
|
|
|
|
|
|
- ::
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .. code:: sh
|
|
|
|
|
|
|
|
torch==2.3.1 torchvision==0.18.1
|
|
torch==2.3.1 torchvision==0.18.1
|
|
|
|
|
|
|
|
- These are the highest versions we support. Installing higher
|
|
|
|
|
- versions without specifying them will cause the program to fail.
|
|
|
|
|
|
|
+ These are the highest versions we support. Installing higher versions without specifying them will cause the program to fail.
|
|
|
|
|
|
|
|
2. **Modify the value of ``"device-mode"``** in the ``magic-pdf.json``
|
|
2. **Modify the value of ``"device-mode"``** in the ``magic-pdf.json``
|
|
|
configuration file located in your user directory.
|
|
configuration file located in your user directory.
|