fix(sdk/cli): Correct HuggingFace model copy
What does this PR address?
2 things, mainly:
-
models/huggingface.py:- Corrects a bug in
HuggingFaceModel.resolvewhere the incorrect source directory (grandparent of the snapshot) was being copied when abase_pathwas provided. I believe this leads to large/incorrect copies. The fix ensures only the specific model snapshot is copied to a correctly named subdirectory within thebase_path
- Corrects a bug in
-
service/factory.py:- Fixes an
AttributeErrorin the deprecatedrunner_servicefunction by initializingconfig["workers"]as a list ([]) instead of a dictionary ({}) 👍
- Fixes an
-
cli/deployment.py:- Removes a duplicate
@click.optiondefinition for--config-file(it's right above the deleted one 👍 )
- Removes a duplicate
Before submitting:
- [x] Does the Pull Request follow Conventional Commits specification naming? Here are GitHub's guide on how to create a pull request.
- [x] Does the code follow BentoML's code style,
pre-commit run -ascript has passed (instructions)? - [x] Did you read through contribution guidelines and follow development guidelines?
- [x] Did your changes require updates to the documentation? Have you updated those accordingly? Here are documentation guidelines and tips on writting docs.
PR Change Summary
This pull request addresses several issues related to the HuggingFace model handling and code improvements in the CLI.
- Corrected a bug in HuggingFace model copying to ensure proper directory structure.
- Fixed an AttributeError in the runner_service function by initializing workers correctly.
- Removed a duplicate option definition in the CLI for better clarity.
Modified Files
-
docs/source/build-with-bentoml/services.rst -
docs/source/examples/mlflow.rst -
docs/source/scale-with-bentocloud/deployment/index.rst
How can I customize these reviews?
Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.
If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.
Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.
Maybe also cc @aarnphm 👍 thx in advance
Let's separate this out into 3 PRs.
The docs PR, the CLI PR, and the HF copy PR.
Can you provide the case when the base_path issue that you run into? A reproducible would be helpful here.
Sure no problem, I made a new PR for the docs
I'll give the example in a sec