Skip to content

Commit

Permalink
Merge pull request #707 from myhloli/master
Browse files Browse the repository at this point in the history
refactor(docs): update model download instructions and configuration process
  • Loading branch information
myhloli authored Oct 9, 2024
2 parents 4ee1034 + 044e84e commit 62aa1cb
Show file tree
Hide file tree
Showing 13 changed files with 167 additions and 1,040 deletions.
26 changes: 6 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,34 +198,20 @@ pip install -U magic-pdf[full] --extra-index-url https://wheels.myhloli.com

Refer to [How to Download Model Files](docs/how_to_download_models_en.md) for detailed instructions.

> ❗️After downloading the models, please make sure to verify the completeness of the model files.
>
> Check if the model file sizes match the description on the webpage. If possible, use sha256 to verify the integrity of the files.
#### 3. Modify the Configuration File for Additional Configuration

#### 3. Copy and configure the template file
After completing the [2. Download model weight files](#2-download-model-weight-files) step, the script will automatically generate a `magic-pdf.json` file in the user directory and configure the default model path.
You can find the `magic-pdf.json` file in your 【user directory】.

You can find the `magic-pdf.template.json` template configuration file in the root directory of the repository.
> The user directory for Windows is "C:\\Users\\username", for Linux it is "/home/username", and for macOS it is "/Users/username".
> ❗️Make sure to execute the following command to copy the configuration file to your **user directory**; otherwise, the program will not run.
>
> The user directory for Windows is `C:\Users\YourUsername`, for Linux it is `/home/YourUsername`, and for macOS it is `/Users/YourUsername`.
You can modify certain configurations in this file to enable or disable features, such as table recognition:

```bash
cp magic-pdf.template.json ~/magic-pdf.json
```

Find the `magic-pdf.json` file in your user directory and configure the "models-dir" path to point to the directory where the model weight files were downloaded in [Step 2](#2-download-model-weight-files).

> ❗️Make sure to correctly configure the **absolute path** to the model weight files directory, otherwise the program will not run because it can't find the model files.
>
> On Windows, this path should include the drive letter and all backslashes (`\`) in the path should be replaced with forward slashes (`/`) to avoid syntax errors in the JSON file due to escape sequences.
>
> For example: If the models are stored in the "models" directory at the root of the D drive, the "model-dir" value should be `D:/models`.
> If the following items are not present in the JSON, please manually add the required items and remove the comment content (standard JSON does not support comments).
```json
{
// other config
"models-dir": "D:/models",
"table-config": {
"model": "TableMaster", // Another option of this value is 'struct_eqtable'
"is_table_recog_enable": false, // Table recognition is disabled by default, modify this value to enable it
Expand Down
328 changes: 0 additions & 328 deletions README.md.bak

This file was deleted.

Loading

0 comments on commit 62aa1cb

Please sign in to comment.