Skip to content

fix(logger): forward printf args through info_once/warning_once - #424

Open
ys2025-AI wants to merge 2 commits into
modelscope:dev-swift-v5from
ys2025-AI:fix/logger-once-args
Open

ys2025-AI wants to merge 2 commits into
modelscope:dev-swift-v5from
ys2025-AI:fix/logger-once-args

Conversation

@ys2025-AI

Copy link
Copy Markdown
Collaborator

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

Summary

info_once / warning_once accept *args for printf-style substitutions but called self.info(msg) / self.warning(msg), dropping those args. Any message using placeholders printed the literal %s / %d instead of the values.

This is visible today in existing code (loading %s with trust_remote_code=True) and in the new language_model_only log:

[TransformersModel] language_model_only: removed unused vision modules after load: %s

Changes

  • Forward *args to self.info / self.warning in info_once / warning_once.
  • Keep hash_id on the unformatted template so the "log exactly once" behavior is unchanged.
  • Apply the repository pre-commit formatter/linter to the touched file.

Signed-off-by: ys2025-AI <yuanshuaien@163.com>
Signed-off-by: ys2025-AI <yuanshuaien@163.com>
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