From 02000f52485b0e1762aea53efd07dbf400b852f5 Mon Sep 17 00:00:00 2001 From: Jamie Brunning <2175270+jjjamie@users.noreply.github.com> Date: Tue, 21 Apr 2026 16:56:39 +0100 Subject: [PATCH] Remove warnings for modernbert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gets rid of annoying logging when importing modernbert ``` [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Config not found for model. You can manually add it to HARDCODED_CONFIG_FOR_MODELS in utils/auto_docstring.py [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Config not found for model. You can manually add it to HARDCODED_CONFIG_FOR_MODELS in utils/auto_docstring.py [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Config not found for model. You can manually add it to HARDCODED_CONFIG_FOR_MODELS in utils/auto_docstring.py [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Config not found for model. You can manually add it to HARDCODED_CONFIG_FOR_MODELS in utils/auto_docstring.py [run] 🚨 No checkpoint found for ModernBertForMaskedLM.forward. Please add a `checkpoint` arg to `auto_docstring` or add one in ModelConfig's docstring [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Config not found for model. You can manually add it to HARDCODED_CONFIG_FOR_MODELS in utils/auto_docstring.py [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Config not found for model. You can manually add it to HARDCODED_CONFIG_FOR_MODELS in utils/auto_docstring.py [run] 🚨 No checkpoint found for ModernBertForSequenceClassification.forward. Please add a `checkpoint` arg to `auto_docstring` or add one in ModelConfig's docstring [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Config not found for model. You can manually add it to HARDCODED_CONFIG_FOR_MODELS in utils/auto_docstring.py [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Config not found for model. You can manually add it to HARDCODED_CONFIG_FOR_MODELS in utils/auto_docstring.py [run] 🚨 No checkpoint found for ModernBertForTokenClassification.forward. Please add a `checkpoint` arg to `auto_docstring` or add one in ModelConfig's docstring [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Config not found for model. You can manually add it to HARDCODED_CONFIG_FOR_MODELS in utils/auto_docstring.py [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Config not found for model. You can manually add it to HARDCODED_CONFIG_FOR_MODELS in utils/auto_docstring.py [run] 🚨 No checkpoint found for ModernBertForQuestionAnswering.forward. Please add a `checkpoint` arg to `auto_docstring` or add one in ModelConfig's docstring [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Config not found for model. You can manually add it to HARDCODED_CONFIG_FOR_MODELS in utils/auto_docstring.py [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Config not found for model. You can manually add it to HARDCODED_CONFIG_FOR_MODELS in utils/auto_docstring.py [run] 🚨 No checkpoint found for ModernBertForMultipleChoice.forward. Please add a `checkpoint` arg to `auto_docstring` or add one in ModelConfig's docstring [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py [run] 🚨 Config not found for model. You can manually add it to HARDCODED_CONFIG_FOR_MODELS in utils/auto_docstring.py [run] 🚨 Something went wrong trying to find the model name in the path: /usr/local/lib/python3.12/dist-packages/transformers/models/modernbert/modular_modernbert.py ``` --- src/transformers/utils/auto_docstring.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/transformers/utils/auto_docstring.py b/src/transformers/utils/auto_docstring.py index bd04f3fb901e..54879685c3d8 100644 --- a/src/transformers/utils/auto_docstring.py +++ b/src/transformers/utils/auto_docstring.py @@ -43,6 +43,7 @@ "image_processing_pil_*.py", "image_processing_*.py", "feature_extractor_*.py", + "modular_*.py", ] PLACEHOLDER_TO_AUTO_MODULE = {