monkey-patch transformers to simplify monkey-patching modeling code (#1877)

* monkey-patch transformers so that monkey-patched modeling code doesnt get overwritten

* unnecessary now

* add comment
This commit is contained in:
Aman Gupta Karmani
2024-08-27 17:22:26 -07:00
committed by GitHub
parent 1e43660701
commit 159b8b9a74
3 changed files with 56 additions and 2 deletions

View File

@@ -94,5 +94,3 @@ def patch_remote(model_name, config_name, modeling_name):
module_name = model_config.__class__.__module__.replace(config_name, modeling_name)
modeling_arch = importlib.import_module(module_name)
modeling_arch._get_unpad_data = get_unpad_data # pylint: disable=protected-access
# workaround to make the patch stick
modeling_arch._axolotl_multipack_patch = True # pylint: disable=protected-access