Skip to content

Commit

Permalink
fix glm4-9b error
Browse files Browse the repository at this point in the history
  • Loading branch information
cyita committed Nov 15, 2024
1 parent 46545f8 commit 6077f37
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions python/llm/src/ipex_llm/transformers/models/chatglm4.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,14 @@ def chatglm4_model_forward(
if full_attention_mask is None:
if (attention_mask is not None and not attention_mask.all()) or\
(past_key_values and seq_length != 1):
full_attention_mask = self.get_masks(inputs_embeds,
past_key_values,
padding_mask=attention_mask)
if self.config.hidden_size == 4096:
full_attention_mask = self.get_masks(input_ids,
past_key_values,
padding_mask=attention_mask)
else:
full_attention_mask = self.get_masks(inputs_embeds,
past_key_values,
padding_mask=attention_mask)

# ipex-llm changes begin
# 1. replace `rotary_pos_emb` with `inv_freq` and `position_ids`
Expand Down

0 comments on commit 6077f37

Please sign in to comment.