From b05c39b9735c7892fa6b26c9b0d72ec1ef639b19 Mon Sep 17 00:00:00 2001 From: Shane A Date: Mon, 1 Apr 2024 17:18:44 -0700 Subject: [PATCH 1/2] Add cache_position dummy parameter to ignore faulty input --- hf_olmo/modeling_olmo.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hf_olmo/modeling_olmo.py b/hf_olmo/modeling_olmo.py index a1cc569f7..32651d1ec 100644 --- a/hf_olmo/modeling_olmo.py +++ b/hf_olmo/modeling_olmo.py @@ -3,6 +3,7 @@ import torch from transformers import PreTrainedModel +from transformers.cache_utils import Cache from transformers.modeling_outputs import CausalLMOutputWithPast from transformers.models.auto import AutoModelForCausalLM @@ -57,6 +58,9 @@ def forward( output_attentions: Optional[bool] = None, output_hidden_states: Optional[bool] = None, return_dict: Optional[bool] = None, + cache_position: Optional[ + Cache + ] = None, # This is a hack mitigation of an issue in transformers `4.39.x` https://github.com/huggingface/transformers/issues/29426 ) -> Union[Tuple, CausalLMOutputWithPast]: if use_cache is None: use_cache = self.config.use_cache From 9d483f7f375a9e5a1eea416f3cc1ef41262027d9 Mon Sep 17 00:00:00 2001 From: Shane A Date: Mon, 1 Apr 2024 17:22:26 -0700 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42439f5de..e80fa5072 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Don't log garbage on nodes that aren't rank 0 - Don't crash in the HF code when we are referring to a tokenizer in a local file - Fixed the size calculation for qk layer norm +- Fixed pipeline test failure that occurs due to a bug in transformers version 4.39.1 ## [v0.2.5](https://github.com/allenai/OLMo/releases/tag/v0.2.5) - 2024-03-06