fix attempt at issue 1991

This commit is contained in:
sunny
2024-10-29 15:44:32 -04:00
parent fc1f275e6c
commit 32b6f30947
2 changed files with 5 additions and 4 deletions

View File

@@ -27,12 +27,14 @@ SUPPORTED_MULTIPACK_MODEL_TYPES = [
]
def patch_for_multipack(model_type, model_name=None, is_remote_code=False):
# def patch_for_multipack(model_type, model_name=None, is_remote_code=False):
def patch_for_multipack(model_type, model_name=None):
if model_type == "gemmoe":
patch_remote(model_name, ".configuration_gemmoe", ".modeling_gemmoe")
elif model_type == "deepseek_v2":
patch_remote(model_name, ".configuration_deepseek", ".modeling_deepseek")
elif hasattr(transformers, "modeling_flash_attention_utils") and not is_remote_code:
# elif hasattr(transformers, "modeling_flash_attention_utils") and not is_remote_code:
elif hasattr(transformers, "modeling_flash_attention_utils"):
transformers.modeling_flash_attention_utils._get_unpad_data = ( # pylint: disable=protected-access
get_unpad_data
)

View File

@@ -393,8 +393,7 @@ class ModelLoader:
self.cfg.model_config_type in SUPPORTED_MULTIPACK_MODEL_TYPES
and self.cfg.flash_attention
and self.cfg.sample_packing
):
LOG.info(f"Model_config_type: {self.cfg.model_config_type}")
):
patch_for_multipack(
self.cfg.model_config_type,
model_name=self.cfg.base_model,