Fix pipeline parameter#1717
Conversation
There was a problem hiding this comment.
Code Review
This pull request improves the propagation of the trust_remote_code parameter across the pipeline and trainer modules, ensuring that security settings are respected during model instantiation. It also introduces a plugin whitelist filter in the base model's security check. Feedback suggests extending this security check to include the allow_remote configuration field for better consistency across the framework.
I am having trouble creating individual review comments. Click here to see my feedback.
modelscope/models/base/base_model.py (194)
For consistency with the security checks in modelscope/pipelines/builder.py and modelscope/trainers/builder.py, the allow_remote field from the configuration should also be checked here. This ensures that models requiring remote code execution are correctly blocked when trust_remote_code is False, even if they don't use plugins.
if (filter_plugin_in_whitelist(plugins) or cfg.get('allow_remote', False)) and not trust_remote_code:
No description provided.