Skip to content

fix(sdk/cli): Correct HuggingFace model copy #5355

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

b8zhong
Copy link
Contributor

@b8zhong b8zhong commented May 14, 2025

What does this PR address?

2 things, mainly:

  1. models/huggingface.py:

    • Corrects a bug in HuggingFaceModel.resolve where the incorrect source directory (grandparent of the snapshot) was being copied when a base_path was 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 the base_path
  2. service/factory.py:

    • Fixes an AttributeError in the deprecated runner_service function by initializing config["workers"] as a list ([]) instead of a dictionary ({}) 👍
  3. cli/deployment.py:

    • Removes a duplicate @click.option definition for --config-file (it's right above the deleted one 👍 )

Before submitting:

@b8zhong b8zhong requested a review from a team as a code owner May 14, 2025 01:12
@b8zhong b8zhong requested review from bojiang and removed request for a team May 14, 2025 01:12
Copy link
Contributor

hyperlint-ai bot commented May 14, 2025

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.

@b8zhong
Copy link
Contributor Author

b8zhong commented May 14, 2025

Maybe also cc @aarnphm 👍 thx in advance

@aarnphm
Copy link
Contributor

aarnphm commented May 14, 2025

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.

@b8zhong
Copy link
Contributor Author

b8zhong commented May 14, 2025

Sure no problem, I made a new PR for the docs

I'll give the example in a sec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants