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

🧹 Cleanup of the batch size environment variables #121

Merged
merged 2 commits into from
Nov 28, 2024

Conversation

baptistecolle
Copy link
Collaborator

@baptistecolle baptistecolle commented Nov 28, 2024

What does this PR do?

  • Refactor HF_BATCH_SIZE and BATCH_SIZE into MAX_BATCH_SIZE
  • Set the default batch size to 4

Why

  • There are multiple conflicting name for the batch variable so it is better to have one global name
  • We are moving to a default batch size of 4 across the repo, this is already the case for inference endpoint deployment

@baptistecolle baptistecolle changed the title 🧹 Cleanup of the batch size environment variable 🧹 Cleanup of the batch size environment variables Nov 28, 2024
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@baptistecolle baptistecolle marked this pull request as ready for review November 28, 2024 09:06
Copy link
Collaborator

@tengomucho tengomucho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the contribution!

@@ -65,7 +65,7 @@ docker run -p 8080:80 \
--net=host --privileged \
-v $(pwd)/data:/data \
-e HF_TOKEN=${HF_TOKEN} \
-e MAX_BATCH_SIZE=1 \
-e MAX_BATCH_SIZE=4 \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could have left it to 1, but it's ok.

if [[ -z "${BATCH_SIZE}" ]]; then
BATCH_SIZE=2
if [[ -z "${MAX_BATCH_SIZE}" ]]; then
MAX_BATCH_SIZE=4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could have done the change from 2 to 4 on the next commit, but anyway that's fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes i though about that but thanks for pointing it out

@baptistecolle baptistecolle merged commit ffa990d into main Nov 28, 2024
5 checks passed
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.

3 participants