Skip to content

Fix warning about parameter max_new_tokens - #1721

Merged
albertvillanova merged 2 commits into
huggingface:mainfrom
albertvillanova:fix-warning-max-new-tokens
Aug 26, 2025
Merged

albertvillanova merged 2 commits into
huggingface:mainfrom
albertvillanova:fix-warning-max-new-tokens

Conversation

@albertvillanova

@albertvillanova albertvillanova commented Aug 26, 2025 •

Copy link
Copy Markdown
Member

Fix warning about parameter max_new_tokens: https://github.com/huggingface/smolagents/actions/runs/17234970996/job/48897627718?pr=1690

UserWarning: max_new_tokens not provided, using this default value for max_new_tokens: 4096

tests/test_cli.py::test_load_model_transformers_model
tests/test_models.py::TestTransformersModel::test_init[patching0]
tests/test_models.py::TestTransformersModel::test_init[patching1]
tests/test_models.py::test_flatten_messages_as_text_for_all_models[TransformersModel-model_kwargs9-patching9-True]
tests/test_models.py::test_flatten_messages_as_text_for_all_models[TransformersModel-model_kwargs10-patching10-False]
  /opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/smolagents/models.py:848: UserWarning: `max_new_tokens` not provided, using this default value for `max_new_tokens`: 4096

This PR sets default max_new_tokens explicitly without warning.

@albertvillanova
albertvillanova merged commit 33c727b into huggingface:main Aug 26, 2025
@albertvillanova
albertvillanova deleted the fix-warning-max-new-tokens branch August 26, 2025 12:54
maxwellfet928 added a commit to maxwellfet928/smolagents that referenced this pull request Jun 8, 2026
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.

1 participant