Skip to content

Commit

Permalink
refactor(docs): update model download instructions and configuration …
Browse files Browse the repository at this point in the history
…process

- Simplify model download instructions, include initial download and updates
- Recommend using Hugging Face or ModelScope for downloading models
- Remove detailed steps for Git LFS download due to reliability issues
- Update configuration file name from template to final version
- Clarify location and automatic generation of the configuration file
- Update READMEs across different platforms to reflect these changes
  • Loading branch information
myhloli committed Oct 9, 2024
1 parent 4ee1034 commit 044e84e
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 044e84e

Please sign in to comment.