huggingface / huggingface/local-gemma

local-gemma is not compatible with transformers 4.47

Open
#44 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
383
Forks
31
PR merge metrics
No merged PRs in 30d

Description

Installing the package using pip, by default installs the latest version of transformers (4.47).
Then, running the local-gemma command, returns the following error.

```
File "/local_gemma/attention.py", line 8, in
from transformers.models.gemma2.modeling_gemma2 import Gemma2RotaryEmbedding, apply_rotary_pos_emb, repeat_kv, GEMMA2_ATTENTION_CLASSES
ImportError: cannot import name 'GEMMA2_ATTENTION_CLASSES' from 'transformers.models.gemma2.modeling_gemma2'
(/transformers/models/gemma2/modeling_gemma2.py)
```

It turns out this has to do with a bug introduced in version 4.47.0 of the transformers package, in the file
'transformers/models/gemma2/modeling_gemma2.py'

Downgrading to version 4.46 solved the issue for me.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.