Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ONNX model path initialization #1578

Merged
merged 7 commits into from
Jan 20, 2025
Merged

Fix ONNX model path initialization #1578

merged 7 commits into from
Jan 20, 2025

Conversation

moria97
Copy link

@moria97 moria97 commented Jan 20, 2025

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

Fix bug when using minerU when using ONNX models with mac:
ValueError: not find model file path <contextlib._GeneratorContextManager object at 0x3dab1ca90>/ch_PP-OCRv4_det_infer.onnx

Modification

The original code uses resource_path = importlib.resources.path('rapidocr_onnxruntime.models', ''), but importlib.resources.path just returns a context manager, we should wrap it with with clause. https://docs.python.org/3/library/importlib.resources.html#importlib.resources.path

BC-breaking (Optional)

Does the modification introduce changes that break the backward compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here and update the documentation.

Checklist

Before PR:

  • Pre-commit or other linting tools are used to fix the potential lint issues.
  • Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests.
  • The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  • The documentation has been modified accordingly, like docstring or example tutorials.

After PR:

  • If the modification has potential influence on downstream or other related projects, this PR should be tested with those projects.
  • CLA has been signed and all committers have signed the CLA in this PR.

myhloli and others added 7 commits January 10, 2025 19:00
docs(README): update version number in release notes
fix: update resource URLs to jsdelivr
docs(faq): add troubleshooting guide for old GPUs encountering CUDA errors
Adjust projects/multi_gpu/server.py for magic_pdf-1.0.1
Copy link
Contributor

github-actions bot commented Jan 20, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@moria97
Copy link
Author

moria97 commented Jan 20, 2025

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jan 20, 2025
@moria97
Copy link
Author

moria97 commented Jan 20, 2025

@myhloli

@myhloli myhloli changed the base branch from master to dev January 20, 2025 07:05
@myhloli myhloli merged commit 96d5bc0 into opendatalab:dev Jan 20, 2025
1 check passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants