transformers v4.49.0-Gemma-3 branch does NOT contain the class ShieldGemmaForImageClassification. What's the correct transformers version for this model?

\n","updatedAt":"2025-03-12T14:55:03.411Z","author":{"_id":"617ba54820949ebe97f0f4b6","avatarUrl":"/avatars/1aae67ad44deef35136a08928988fcfc.svg","fullname":"JiaKuan Su","name":"feabries","type":"user","isPro":false,"isHf":false,"isMod":false}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.7197004556655884},"editors":["feabries"],"editorAvatarUrls":["/avatars/1aae67ad44deef35136a08928988fcfc.svg"],"reactions":[],"isReport":false}},{"id":"67d1bd6aeffa57e48f556dc0","author":{"_id":"65f57657e9e9e3a5f20adb9f","avatarUrl":"/avatars/efc784d0ffd1eb61f7b9aed2697181fa.svg","fullname":"Patel","name":"Renu11","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":1,"isOwner":false,"isOrgMember":true},"createdAt":"2025-03-12T16:59:22.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"To use Gemma-3 models, you need the latest development version of the Transformers library (4.50.0.dev0). You can install it directly from the GitHub branch using: `pip install git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3` as mentioned [here](https://huggingface.co/google/shieldgemma-2-4b-it#usage).","html":"

To use Gemma-3 models, you need the latest development version of the Transformers library (4.50.0.dev0). You can install it directly from the GitHub branch using: pip install git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3 as mentioned here.

\n","updatedAt":"2025-03-12T16:59:22.304Z","author":{"_id":"65f57657e9e9e3a5f20adb9f","avatarUrl":"/avatars/efc784d0ffd1eb61f7b9aed2697181fa.svg","fullname":"Patel","name":"Renu11","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":1}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.6532611846923828},"editors":["Renu11"],"editorAvatarUrls":["/avatars/efc784d0ffd1eb61f7b9aed2697181fa.svg"],"reactions":[],"isReport":false}},{"id":"67d1cbb35b837ff0e867883c","author":{"_id":"617ba54820949ebe97f0f4b6","avatarUrl":"/avatars/1aae67ad44deef35136a08928988fcfc.svg","fullname":"JiaKuan Su","name":"feabries","type":"user","isPro":false,"isHf":false,"isMod":false,"isOwner":false,"isOrgMember":false},"createdAt":"2025-03-12T18:00:19.000Z","type":"comment","data":{"edited":true,"hidden":false,"latest":{"raw":"@Renu11 Thank you! But I did install that version of the transformers by following the instructions on the Model Card. I also checked the source code and found `ShieldGemmaForImageClassification` does not exist.","html":"

\n\n@Renu11\n\t Thank you! But I did install that version of the transformers by following the instructions on the Model Card. I also checked the source code and found ShieldGemmaForImageClassification does not exist.

\n","updatedAt":"2025-03-12T18:02:31.809Z","author":{"_id":"617ba54820949ebe97f0f4b6","avatarUrl":"/avatars/1aae67ad44deef35136a08928988fcfc.svg","fullname":"JiaKuan Su","name":"feabries","type":"user","isPro":false,"isHf":false,"isMod":false}},"numEdits":1,"identifiedLanguage":{"language":"en","probability":0.931593120098114},"editors":["feabries"],"editorAvatarUrls":["/avatars/1aae67ad44deef35136a08928988fcfc.svg"],"reactions":[],"isReport":false}},{"id":"67d1f579825fbe674d0d1e8d","author":{"_id":"6500af0912c1442d99483546","avatarUrl":"/avatars/b1699d090cfe18837ca3f95257e03586.svg","fullname":"Puneet Jain","name":"pjainrbx","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":2,"isOwner":false,"isOrgMember":false},"createdAt":"2025-03-12T20:58:33.000Z","type":"comment","data":{"edited":true,"hidden":false,"latest":{"raw":"@Renu11 \n\n$ pip install git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3\n```\nDefaulting to user installation because normal site-packages is not writeable\nLooking in indexes: http://pypiproxy.xxx:8080/simple\nCollecting git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3\n Cloning https://github.com/huggingface/transformers (to revision v4.49.0-Gemma-3) to /tmp/pip-req-build-7bx5foet\n Running command git clone --filter=blob:none --quiet https://github.com/huggingface/transformers /tmp/pip-req-build-7bx5foet\n Running command git checkout -q 1c0f782fe5f983727ff245c4c1b3906f9b99eec2\n Resolved https://github.com/huggingface/transformers to commit 1c0f782fe5f983727ff245c4c1b3906f9b99eec2\n Installing build dependencies ... done\n Getting requirements to build wheel ... done\n Preparing metadata (pyproject.toml) ... done\nRequirement already satisfied: filelock in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (3.13.4)\nRequirement already satisfied: huggingface-hub<1.0,>=0.26.0 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.29.3)\nRequirement already satisfied: numpy>=1.17 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (1.22.4)\nRequirement already satisfied: packaging>=20.0 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (24.0)\nRequirement already satisfied: pyyaml>=5.1 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (6.0.1)\nRequirement already satisfied: regex!=2019.12.17 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (2024.11.6)\nRequirement already satisfied: requests in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (2.31.0)\nRequirement already satisfied: tokenizers<0.22,>=0.21 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.21.0)\nRequirement already satisfied: safetensors>=0.4.1 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.5.2)\nRequirement already satisfied: tqdm>=4.27 in /opt/conda/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (4.64.1)\nRequirement already satisfied: fsspec>=2023.5.0 in /home/jovyan/.local/lib/python3.10/site-packages (from huggingface-hub<1.0,>=0.26.0->transformers==4.50.0.dev0) (2024.12.0)\nRequirement already satisfied: typing-extensions>=3.7.4.3 in /home/jovyan/.local/lib/python3.10/site-packages (from huggingface-hub<1.0,>=0.26.0->transformers==4.50.0.dev0) (4.12.2)\nRequirement already satisfied: charset-normalizer<4,>=2 in /home/jovyan/.local/lib/python3.10/site-packages (from requests->transformers==4.50.0.dev0) (3.3.2)\nRequirement already satisfied: idna<4,>=2.5 in /home/jovyan/.local/lib/python3.10/site-packages (from requests->transformers==4.50.0.dev0) (3.7)\nRequirement already satisfied: urllib3<3,>=1.21.1 in /home/jovyan/.local/lib/python3.10/site-packages (from requests->transformers==4.50.0.dev0) (1.26.11)\nRequirement already satisfied: certifi>=2017.4.17 in /home/jovyan/.local/lib/python3.10/site-packages (from requests->transformers==4.50.0.dev0) (2024.2.2)\nBuilding wheels for collected packages: transformers\n Building wheel for transformers (pyproject.toml) ... done\n Created wheel for transformers: filename=transformers-4.50.0.dev0-py3-none-any.whl size=10936429 sha256=d192084136fb29c56ac7366435089fab7699866f1ffcefdeb3ae35702bb11dc3\n Stored in directory: /tmp/pip-ephem-wheel-cache-lyy5dd1u/wheels/c1/95/d1/7d800368ab25942bf88f88fe1716597fcc8d757043c9b48a2f\nSuccessfully built transformers\nInstalling collected packages: transformers\nSuccessfully installed transformers-4.50.0.dev0\n```\n\n\nAnd then still getting\n\n```\n---------------------------------------------------------------------------\nImportError Traceback (most recent call last)\nCell In[1], line 3\n 1 # pip install accelerate\n----> 3 from transformers import AutoProcessor, ShieldGemmaForImageClassification\n 4 from PIL import Image\n 5 import requests\n\nImportError: cannot import name 'ShieldGemmaForImageClassification' from 'transformers'\n```","html":"

\n\n@Renu11\n\t

\n

$ pip install git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3

\n
Defaulting to user installation because normal site-packages is not writeable\nLooking in indexes: http://pypiproxy.xxx:8080/simple\nCollecting git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3\n  Cloning https://github.com/huggingface/transformers (to revision v4.49.0-Gemma-3) to /tmp/pip-req-build-7bx5foet\n  Running command git clone --filter=blob:none --quiet https://github.com/huggingface/transformers /tmp/pip-req-build-7bx5foet\n  Running command git checkout -q 1c0f782fe5f983727ff245c4c1b3906f9b99eec2\n  Resolved https://github.com/huggingface/transformers to commit 1c0f782fe5f983727ff245c4c1b3906f9b99eec2\n  Installing build dependencies ... done\n  Getting requirements to build wheel ... done\n  Preparing metadata (pyproject.toml) ... done\nRequirement already satisfied: filelock in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (3.13.4)\nRequirement already satisfied: huggingface-hub&lt;1.0,&gt;=0.26.0 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.29.3)\nRequirement already satisfied: numpy&gt;=1.17 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (1.22.4)\nRequirement already satisfied: packaging&gt;=20.0 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (24.0)\nRequirement already satisfied: pyyaml&gt;=5.1 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (6.0.1)\nRequirement already satisfied: regex!=2019.12.17 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (2024.11.6)\nRequirement already satisfied: requests in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (2.31.0)\nRequirement already satisfied: tokenizers&lt;0.22,&gt;=0.21 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.21.0)\nRequirement already satisfied: safetensors&gt;=0.4.1 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.5.2)\nRequirement already satisfied: tqdm&gt;=4.27 in /opt/conda/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (4.64.1)\nRequirement already satisfied: fsspec&gt;=2023.5.0 in /home/jovyan/.local/lib/python3.10/site-packages (from huggingface-hub&lt;1.0,&gt;=0.26.0-&gt;transformers==4.50.0.dev0) (2024.12.0)\nRequirement already satisfied: typing-extensions&gt;=3.7.4.3 in /home/jovyan/.local/lib/python3.10/site-packages (from huggingface-hub&lt;1.0,&gt;=0.26.0-&gt;transformers==4.50.0.dev0) (4.12.2)\nRequirement already satisfied: charset-normalizer&lt;4,&gt;=2 in /home/jovyan/.local/lib/python3.10/site-packages (from requests-&gt;transformers==4.50.0.dev0) (3.3.2)\nRequirement already satisfied: idna&lt;4,&gt;=2.5 in /home/jovyan/.local/lib/python3.10/site-packages (from requests-&gt;transformers==4.50.0.dev0) (3.7)\nRequirement already satisfied: urllib3&lt;3,&gt;=1.21.1 in /home/jovyan/.local/lib/python3.10/site-packages (from requests-&gt;transformers==4.50.0.dev0) (1.26.11)\nRequirement already satisfied: certifi&gt;=2017.4.17 in /home/jovyan/.local/lib/python3.10/site-packages (from requests-&gt;transformers==4.50.0.dev0) (2024.2.2)\nBuilding wheels for collected packages: transformers\n  Building wheel for transformers (pyproject.toml) ... done\n  Created wheel for transformers: filename=transformers-4.50.0.dev0-py3-none-any.whl size=10936429 sha256=d192084136fb29c56ac7366435089fab7699866f1ffcefdeb3ae35702bb11dc3\n  Stored in directory: /tmp/pip-ephem-wheel-cache-lyy5dd1u/wheels/c1/95/d1/7d800368ab25942bf88f88fe1716597fcc8d757043c9b48a2f\nSuccessfully built transformers\nInstalling collected packages: transformers\nSuccessfully installed transformers-4.50.0.dev0\n
\n

And then still getting

\n
---------------------------------------------------------------------------\nImportError                               Traceback (most recent call last)\nCell In[1], line 3\n      1 # pip install accelerate\n----&gt; 3 from transformers import AutoProcessor, ShieldGemmaForImageClassification\n      4 from PIL import Image\n      5 import requests\n\nImportError: cannot import name 'ShieldGemmaForImageClassification' from 'transformers'\n
\n","updatedAt":"2025-03-12T23:41:54.288Z","author":{"_id":"6500af0912c1442d99483546","avatarUrl":"/avatars/b1699d090cfe18837ca3f95257e03586.svg","fullname":"Puneet Jain","name":"pjainrbx","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":2}},"numEdits":3,"identifiedLanguage":{"language":"en","probability":0.6764066815376282},"editors":["pjainrbx"],"editorAvatarUrls":["/avatars/b1699d090cfe18837ca3f95257e03586.svg"],"reactions":[],"isReport":false}},{"id":"67d2128034eb54912d66e69e","author":{"_id":"64d0b70873dc458c163aabd9","avatarUrl":"/avatars/d9d03b241c5d316f609ed1f4205e3e64.svg","fullname":"ZXD","name":"BITDDD","type":"user","isPro":false,"isHf":false,"isMod":false,"isOwner":false,"isOrgMember":false},"createdAt":"2025-03-12T23:02:24.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"the same question, I have installed dev transformers by git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3, but it doesn't work\n\n![image.png](https://cdn-uploads.huggingface.co/production/uploads/64d0b70873dc458c163aabd9/QcNYjGTRS-maRHt0j40Tj.png)\n","html":"

the same question, I have installed dev transformers by git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3, but it doesn't work

\n

\"image.png\"

\n","updatedAt":"2025-03-12T23:02:24.063Z","author":{"_id":"64d0b70873dc458c163aabd9","avatarUrl":"/avatars/d9d03b241c5d316f609ed1f4205e3e64.svg","fullname":"ZXD","name":"BITDDD","type":"user","isPro":false,"isHf":false,"isMod":false}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.7636486887931824},"editors":["BITDDD"],"editorAvatarUrls":["/avatars/d9d03b241c5d316f609ed1f4205e3e64.svg"],"reactions":[],"isReport":false}},{"id":"67d2b09ac8d0ded94bab0689","author":{"_id":"65f57657e9e9e3a5f20adb9f","avatarUrl":"/avatars/efc784d0ffd1eb61f7b9aed2697181fa.svg","fullname":"Patel","name":"Renu11","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":1,"isOwner":false,"isOrgMember":true},"createdAt":"2025-03-13T10:16:58.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Thank you for bringing this issue to our attention. We are currently investigating it.\n","html":"

Thank you for bringing this issue to our attention. We are currently investigating it.

\n","updatedAt":"2025-03-13T10:16:58.828Z","author":{"_id":"65f57657e9e9e3a5f20adb9f","avatarUrl":"/avatars/efc784d0ffd1eb61f7b9aed2697181fa.svg","fullname":"Patel","name":"Renu11","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":1}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.9806308746337891},"editors":["Renu11"],"editorAvatarUrls":["/avatars/efc784d0ffd1eb61f7b9aed2697181fa.svg"],"reactions":[],"isReport":false}},{"id":"67d2d92f27afdd970a6cf4fb","author":{"_id":"65a402a53522df7a27125823","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/65a402a53522df7a27125823/tVR6lZlKmjPqi7dTZBGoS.jpeg","fullname":"Ryan Mullins","name":"RyanMullins","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":5,"isOwner":false,"isOrgMember":true},"createdAt":"2025-03-13T13:10:07.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Hi @BITDDD! I'm the ShieldGemma technical lead and the problem you're having is because the model class is still being reviewed and integrated into Transformers. We had intended to land both PRs at the same time but ran into some process hiccups yesterday. It's expected to land later today. Follow along here: https://github.com/huggingface/transformers/pull/36678 ","html":"

Hi \n\n@BITDDD\n\t! I'm the ShieldGemma technical lead and the problem you're having is because the model class is still being reviewed and integrated into Transformers. We had intended to land both PRs at the same time but ran into some process hiccups yesterday. It's expected to land later today. Follow along here: https://github.com/huggingface/transformers/pull/36678

\n","updatedAt":"2025-03-13T13:10:07.423Z","author":{"_id":"65a402a53522df7a27125823","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/65a402a53522df7a27125823/tVR6lZlKmjPqi7dTZBGoS.jpeg","fullname":"Ryan Mullins","name":"RyanMullins","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":5}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.9839315414428711},"editors":["RyanMullins"],"editorAvatarUrls":["https://cdn-avatars.huggingface.co/v1/production/uploads/65a402a53522df7a27125823/tVR6lZlKmjPqi7dTZBGoS.jpeg"],"reactions":[{"reaction":"👍","users":["changhwo87"],"count":1}],"isReport":false}},{"id":"67d2e0a73c4940edec086807","author":{"_id":"66d957ff66e970a15f064438","avatarUrl":"/avatars/282f074e28175eb2d7dfd95cd9d03eac.svg","fullname":"changhwa oh","name":"changhwo87","type":"user","isPro":false,"isHf":false,"isMod":false,"isOwner":false,"isOrgMember":false},"createdAt":"2025-03-13T13:41:59.000Z","type":"comment","data":{"edited":true,"hidden":false,"latest":{"raw":"@RyanMullins \n\nI was curious, so I immediately accepted the PR and installed it.\n\n```\npip install git+https://github.com/RyanMullins/transformers.git@shieldgemma2\n```\n\nIt still didn't work as described in the Model Card.\nAfter reading the PR, I found that it's ShieldGemma2ForImageClassification, not ShieldGemmaForImageClassification\n\nEverything is working well now—thanks for the PR!","html":"

\n\n@RyanMullins\n\t

\n

I was curious, so I immediately accepted the PR and installed it.

\n
pip install git+https://github.com/RyanMullins/transformers.git@shieldgemma2\n
\n

It still didn't work as described in the Model Card.
After reading the PR, I found that it's ShieldGemma2ForImageClassification, not ShieldGemmaForImageClassification

\n

Everything is working well now—thanks for the PR!

\n","updatedAt":"2025-03-13T13:46:09.178Z","author":{"_id":"66d957ff66e970a15f064438","avatarUrl":"/avatars/282f074e28175eb2d7dfd95cd9d03eac.svg","fullname":"changhwa oh","name":"changhwo87","type":"user","isPro":false,"isHf":false,"isMod":false}},"numEdits":2,"identifiedLanguage":{"language":"en","probability":0.9504064321517944},"editors":["changhwo87"],"editorAvatarUrls":["/avatars/282f074e28175eb2d7dfd95cd9d03eac.svg"],"reactions":[],"isReport":false}}],"pinned":false,"locked":false,"collection":"discussions","isPullRequest":false,"isReport":false},"repo":{"name":"google/shieldgemma-2-4b-it","type":"model"},"activeTab":"discussion","discussionRole":0}">

ImportError: cannot import name 'ShieldGemmaForImageClassification' from 'transformers'

#1
by feabries - opened
transformers v4.49.0-Gemma-3 branch does NOT contain the class ShieldGemmaForImageClassification. What's the correct transformers version for this model?

\n","updatedAt":"2025-03-12T14:55:03.411Z","author":{"_id":"617ba54820949ebe97f0f4b6","avatarUrl":"/avatars/1aae67ad44deef35136a08928988fcfc.svg","fullname":"JiaKuan Su","name":"feabries","type":"user","isPro":false,"isHf":false,"isMod":false}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.7197004556655884},"editors":["feabries"],"editorAvatarUrls":["/avatars/1aae67ad44deef35136a08928988fcfc.svg"],"reactions":[],"isReport":false}},{"id":"67d1bd6aeffa57e48f556dc0","author":{"_id":"65f57657e9e9e3a5f20adb9f","avatarUrl":"/avatars/efc784d0ffd1eb61f7b9aed2697181fa.svg","fullname":"Patel","name":"Renu11","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":1,"isOwner":false,"isOrgMember":true},"createdAt":"2025-03-12T16:59:22.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"To use Gemma-3 models, you need the latest development version of the Transformers library (4.50.0.dev0). You can install it directly from the GitHub branch using: `pip install git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3` as mentioned [here](https://huggingface.co/google/shieldgemma-2-4b-it#usage).","html":"

To use Gemma-3 models, you need the latest development version of the Transformers library (4.50.0.dev0). You can install it directly from the GitHub branch using: pip install git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3 as mentioned here.

\n","updatedAt":"2025-03-12T16:59:22.304Z","author":{"_id":"65f57657e9e9e3a5f20adb9f","avatarUrl":"/avatars/efc784d0ffd1eb61f7b9aed2697181fa.svg","fullname":"Patel","name":"Renu11","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":1}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.6532611846923828},"editors":["Renu11"],"editorAvatarUrls":["/avatars/efc784d0ffd1eb61f7b9aed2697181fa.svg"],"reactions":[],"isReport":false}},{"id":"67d1cbb35b837ff0e867883c","author":{"_id":"617ba54820949ebe97f0f4b6","avatarUrl":"/avatars/1aae67ad44deef35136a08928988fcfc.svg","fullname":"JiaKuan Su","name":"feabries","type":"user","isPro":false,"isHf":false,"isMod":false,"isOwner":false,"isOrgMember":false},"createdAt":"2025-03-12T18:00:19.000Z","type":"comment","data":{"edited":true,"hidden":false,"latest":{"raw":"@Renu11 Thank you! But I did install that version of the transformers by following the instructions on the Model Card. I also checked the source code and found `ShieldGemmaForImageClassification` does not exist.","html":"

\n\n@Renu11\n\t Thank you! But I did install that version of the transformers by following the instructions on the Model Card. I also checked the source code and found ShieldGemmaForImageClassification does not exist.

\n","updatedAt":"2025-03-12T18:02:31.809Z","author":{"_id":"617ba54820949ebe97f0f4b6","avatarUrl":"/avatars/1aae67ad44deef35136a08928988fcfc.svg","fullname":"JiaKuan Su","name":"feabries","type":"user","isPro":false,"isHf":false,"isMod":false}},"numEdits":1,"identifiedLanguage":{"language":"en","probability":0.931593120098114},"editors":["feabries"],"editorAvatarUrls":["/avatars/1aae67ad44deef35136a08928988fcfc.svg"],"reactions":[],"isReport":false}},{"id":"67d1f579825fbe674d0d1e8d","author":{"_id":"6500af0912c1442d99483546","avatarUrl":"/avatars/b1699d090cfe18837ca3f95257e03586.svg","fullname":"Puneet Jain","name":"pjainrbx","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":2,"isOwner":false,"isOrgMember":false},"createdAt":"2025-03-12T20:58:33.000Z","type":"comment","data":{"edited":true,"hidden":false,"latest":{"raw":"@Renu11 \n\n$ pip install git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3\n```\nDefaulting to user installation because normal site-packages is not writeable\nLooking in indexes: http://pypiproxy.xxx:8080/simple\nCollecting git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3\n Cloning https://github.com/huggingface/transformers (to revision v4.49.0-Gemma-3) to /tmp/pip-req-build-7bx5foet\n Running command git clone --filter=blob:none --quiet https://github.com/huggingface/transformers /tmp/pip-req-build-7bx5foet\n Running command git checkout -q 1c0f782fe5f983727ff245c4c1b3906f9b99eec2\n Resolved https://github.com/huggingface/transformers to commit 1c0f782fe5f983727ff245c4c1b3906f9b99eec2\n Installing build dependencies ... done\n Getting requirements to build wheel ... done\n Preparing metadata (pyproject.toml) ... done\nRequirement already satisfied: filelock in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (3.13.4)\nRequirement already satisfied: huggingface-hub<1.0,>=0.26.0 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.29.3)\nRequirement already satisfied: numpy>=1.17 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (1.22.4)\nRequirement already satisfied: packaging>=20.0 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (24.0)\nRequirement already satisfied: pyyaml>=5.1 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (6.0.1)\nRequirement already satisfied: regex!=2019.12.17 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (2024.11.6)\nRequirement already satisfied: requests in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (2.31.0)\nRequirement already satisfied: tokenizers<0.22,>=0.21 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.21.0)\nRequirement already satisfied: safetensors>=0.4.1 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.5.2)\nRequirement already satisfied: tqdm>=4.27 in /opt/conda/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (4.64.1)\nRequirement already satisfied: fsspec>=2023.5.0 in /home/jovyan/.local/lib/python3.10/site-packages (from huggingface-hub<1.0,>=0.26.0->transformers==4.50.0.dev0) (2024.12.0)\nRequirement already satisfied: typing-extensions>=3.7.4.3 in /home/jovyan/.local/lib/python3.10/site-packages (from huggingface-hub<1.0,>=0.26.0->transformers==4.50.0.dev0) (4.12.2)\nRequirement already satisfied: charset-normalizer<4,>=2 in /home/jovyan/.local/lib/python3.10/site-packages (from requests->transformers==4.50.0.dev0) (3.3.2)\nRequirement already satisfied: idna<4,>=2.5 in /home/jovyan/.local/lib/python3.10/site-packages (from requests->transformers==4.50.0.dev0) (3.7)\nRequirement already satisfied: urllib3<3,>=1.21.1 in /home/jovyan/.local/lib/python3.10/site-packages (from requests->transformers==4.50.0.dev0) (1.26.11)\nRequirement already satisfied: certifi>=2017.4.17 in /home/jovyan/.local/lib/python3.10/site-packages (from requests->transformers==4.50.0.dev0) (2024.2.2)\nBuilding wheels for collected packages: transformers\n Building wheel for transformers (pyproject.toml) ... done\n Created wheel for transformers: filename=transformers-4.50.0.dev0-py3-none-any.whl size=10936429 sha256=d192084136fb29c56ac7366435089fab7699866f1ffcefdeb3ae35702bb11dc3\n Stored in directory: /tmp/pip-ephem-wheel-cache-lyy5dd1u/wheels/c1/95/d1/7d800368ab25942bf88f88fe1716597fcc8d757043c9b48a2f\nSuccessfully built transformers\nInstalling collected packages: transformers\nSuccessfully installed transformers-4.50.0.dev0\n```\n\n\nAnd then still getting\n\n```\n---------------------------------------------------------------------------\nImportError Traceback (most recent call last)\nCell In[1], line 3\n 1 # pip install accelerate\n----> 3 from transformers import AutoProcessor, ShieldGemmaForImageClassification\n 4 from PIL import Image\n 5 import requests\n\nImportError: cannot import name 'ShieldGemmaForImageClassification' from 'transformers'\n```","html":"

\n\n@Renu11\n\t

\n

$ pip install git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3

\n
Defaulting to user installation because normal site-packages is not writeable\nLooking in indexes: http://pypiproxy.xxx:8080/simple\nCollecting git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3\n  Cloning https://github.com/huggingface/transformers (to revision v4.49.0-Gemma-3) to /tmp/pip-req-build-7bx5foet\n  Running command git clone --filter=blob:none --quiet https://github.com/huggingface/transformers /tmp/pip-req-build-7bx5foet\n  Running command git checkout -q 1c0f782fe5f983727ff245c4c1b3906f9b99eec2\n  Resolved https://github.com/huggingface/transformers to commit 1c0f782fe5f983727ff245c4c1b3906f9b99eec2\n  Installing build dependencies ... done\n  Getting requirements to build wheel ... done\n  Preparing metadata (pyproject.toml) ... done\nRequirement already satisfied: filelock in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (3.13.4)\nRequirement already satisfied: huggingface-hub&lt;1.0,&gt;=0.26.0 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.29.3)\nRequirement already satisfied: numpy&gt;=1.17 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (1.22.4)\nRequirement already satisfied: packaging&gt;=20.0 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (24.0)\nRequirement already satisfied: pyyaml&gt;=5.1 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (6.0.1)\nRequirement already satisfied: regex!=2019.12.17 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (2024.11.6)\nRequirement already satisfied: requests in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (2.31.0)\nRequirement already satisfied: tokenizers&lt;0.22,&gt;=0.21 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.21.0)\nRequirement already satisfied: safetensors&gt;=0.4.1 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.5.2)\nRequirement already satisfied: tqdm&gt;=4.27 in /opt/conda/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (4.64.1)\nRequirement already satisfied: fsspec&gt;=2023.5.0 in /home/jovyan/.local/lib/python3.10/site-packages (from huggingface-hub&lt;1.0,&gt;=0.26.0-&gt;transformers==4.50.0.dev0) (2024.12.0)\nRequirement already satisfied: typing-extensions&gt;=3.7.4.3 in /home/jovyan/.local/lib/python3.10/site-packages (from huggingface-hub&lt;1.0,&gt;=0.26.0-&gt;transformers==4.50.0.dev0) (4.12.2)\nRequirement already satisfied: charset-normalizer&lt;4,&gt;=2 in /home/jovyan/.local/lib/python3.10/site-packages (from requests-&gt;transformers==4.50.0.dev0) (3.3.2)\nRequirement already satisfied: idna&lt;4,&gt;=2.5 in /home/jovyan/.local/lib/python3.10/site-packages (from requests-&gt;transformers==4.50.0.dev0) (3.7)\nRequirement already satisfied: urllib3&lt;3,&gt;=1.21.1 in /home/jovyan/.local/lib/python3.10/site-packages (from requests-&gt;transformers==4.50.0.dev0) (1.26.11)\nRequirement already satisfied: certifi&gt;=2017.4.17 in /home/jovyan/.local/lib/python3.10/site-packages (from requests-&gt;transformers==4.50.0.dev0) (2024.2.2)\nBuilding wheels for collected packages: transformers\n  Building wheel for transformers (pyproject.toml) ... done\n  Created wheel for transformers: filename=transformers-4.50.0.dev0-py3-none-any.whl size=10936429 sha256=d192084136fb29c56ac7366435089fab7699866f1ffcefdeb3ae35702bb11dc3\n  Stored in directory: /tmp/pip-ephem-wheel-cache-lyy5dd1u/wheels/c1/95/d1/7d800368ab25942bf88f88fe1716597fcc8d757043c9b48a2f\nSuccessfully built transformers\nInstalling collected packages: transformers\nSuccessfully installed transformers-4.50.0.dev0\n
\n

And then still getting

\n
---------------------------------------------------------------------------\nImportError                               Traceback (most recent call last)\nCell In[1], line 3\n      1 # pip install accelerate\n----&gt; 3 from transformers import AutoProcessor, ShieldGemmaForImageClassification\n      4 from PIL import Image\n      5 import requests\n\nImportError: cannot import name 'ShieldGemmaForImageClassification' from 'transformers'\n
\n","updatedAt":"2025-03-12T23:41:54.288Z","author":{"_id":"6500af0912c1442d99483546","avatarUrl":"/avatars/b1699d090cfe18837ca3f95257e03586.svg","fullname":"Puneet Jain","name":"pjainrbx","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":2}},"numEdits":3,"identifiedLanguage":{"language":"en","probability":0.6764066815376282},"editors":["pjainrbx"],"editorAvatarUrls":["/avatars/b1699d090cfe18837ca3f95257e03586.svg"],"reactions":[],"isReport":false}},{"id":"67d2128034eb54912d66e69e","author":{"_id":"64d0b70873dc458c163aabd9","avatarUrl":"/avatars/d9d03b241c5d316f609ed1f4205e3e64.svg","fullname":"ZXD","name":"BITDDD","type":"user","isPro":false,"isHf":false,"isMod":false,"isOwner":false,"isOrgMember":false},"createdAt":"2025-03-12T23:02:24.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"the same question, I have installed dev transformers by git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3, but it doesn't work\n\n![image.png](https://cdn-uploads.huggingface.co/production/uploads/64d0b70873dc458c163aabd9/QcNYjGTRS-maRHt0j40Tj.png)\n","html":"

the same question, I have installed dev transformers by git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3, but it doesn't work

\n

\"image.png\"

\n","updatedAt":"2025-03-12T23:02:24.063Z","author":{"_id":"64d0b70873dc458c163aabd9","avatarUrl":"/avatars/d9d03b241c5d316f609ed1f4205e3e64.svg","fullname":"ZXD","name":"BITDDD","type":"user","isPro":false,"isHf":false,"isMod":false}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.7636486887931824},"editors":["BITDDD"],"editorAvatarUrls":["/avatars/d9d03b241c5d316f609ed1f4205e3e64.svg"],"reactions":[],"isReport":false}},{"id":"67d2b09ac8d0ded94bab0689","author":{"_id":"65f57657e9e9e3a5f20adb9f","avatarUrl":"/avatars/efc784d0ffd1eb61f7b9aed2697181fa.svg","fullname":"Patel","name":"Renu11","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":1,"isOwner":false,"isOrgMember":true},"createdAt":"2025-03-13T10:16:58.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Thank you for bringing this issue to our attention. We are currently investigating it.\n","html":"

Thank you for bringing this issue to our attention. We are currently investigating it.

\n","updatedAt":"2025-03-13T10:16:58.828Z","author":{"_id":"65f57657e9e9e3a5f20adb9f","avatarUrl":"/avatars/efc784d0ffd1eb61f7b9aed2697181fa.svg","fullname":"Patel","name":"Renu11","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":1}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.9806308746337891},"editors":["Renu11"],"editorAvatarUrls":["/avatars/efc784d0ffd1eb61f7b9aed2697181fa.svg"],"reactions":[],"isReport":false}},{"id":"67d2d92f27afdd970a6cf4fb","author":{"_id":"65a402a53522df7a27125823","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/65a402a53522df7a27125823/tVR6lZlKmjPqi7dTZBGoS.jpeg","fullname":"Ryan Mullins","name":"RyanMullins","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":5,"isOwner":false,"isOrgMember":true},"createdAt":"2025-03-13T13:10:07.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Hi @BITDDD! I'm the ShieldGemma technical lead and the problem you're having is because the model class is still being reviewed and integrated into Transformers. We had intended to land both PRs at the same time but ran into some process hiccups yesterday. It's expected to land later today. Follow along here: https://github.com/huggingface/transformers/pull/36678 ","html":"

Hi \n\n@BITDDD\n\t! I'm the ShieldGemma technical lead and the problem you're having is because the model class is still being reviewed and integrated into Transformers. We had intended to land both PRs at the same time but ran into some process hiccups yesterday. It's expected to land later today. Follow along here: https://github.com/huggingface/transformers/pull/36678

\n","updatedAt":"2025-03-13T13:10:07.423Z","author":{"_id":"65a402a53522df7a27125823","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/65a402a53522df7a27125823/tVR6lZlKmjPqi7dTZBGoS.jpeg","fullname":"Ryan Mullins","name":"RyanMullins","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":5}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.9839315414428711},"editors":["RyanMullins"],"editorAvatarUrls":["https://cdn-avatars.huggingface.co/v1/production/uploads/65a402a53522df7a27125823/tVR6lZlKmjPqi7dTZBGoS.jpeg"],"reactions":[{"reaction":"👍","users":["changhwo87"],"count":1}],"isReport":false}},{"id":"67d2e0a73c4940edec086807","author":{"_id":"66d957ff66e970a15f064438","avatarUrl":"/avatars/282f074e28175eb2d7dfd95cd9d03eac.svg","fullname":"changhwa oh","name":"changhwo87","type":"user","isPro":false,"isHf":false,"isMod":false,"isOwner":false,"isOrgMember":false},"createdAt":"2025-03-13T13:41:59.000Z","type":"comment","data":{"edited":true,"hidden":false,"latest":{"raw":"@RyanMullins \n\nI was curious, so I immediately accepted the PR and installed it.\n\n```\npip install git+https://github.com/RyanMullins/transformers.git@shieldgemma2\n```\n\nIt still didn't work as described in the Model Card.\nAfter reading the PR, I found that it's ShieldGemma2ForImageClassification, not ShieldGemmaForImageClassification\n\nEverything is working well now—thanks for the PR!","html":"

\n\n@RyanMullins\n\t

\n

I was curious, so I immediately accepted the PR and installed it.

\n
pip install git+https://github.com/RyanMullins/transformers.git@shieldgemma2\n
\n

It still didn't work as described in the Model Card.
After reading the PR, I found that it's ShieldGemma2ForImageClassification, not ShieldGemmaForImageClassification

\n

Everything is working well now—thanks for the PR!

\n","updatedAt":"2025-03-13T13:46:09.178Z","author":{"_id":"66d957ff66e970a15f064438","avatarUrl":"/avatars/282f074e28175eb2d7dfd95cd9d03eac.svg","fullname":"changhwa oh","name":"changhwo87","type":"user","isPro":false,"isHf":false,"isMod":false}},"numEdits":2,"identifiedLanguage":{"language":"en","probability":0.9504064321517944},"editors":["changhwo87"],"editorAvatarUrls":["/avatars/282f074e28175eb2d7dfd95cd9d03eac.svg"],"reactions":[],"isReport":false}}],"pinned":false,"locked":false,"collection":"discussions","isPullRequest":false,"isReport":false},"primaryEmailConfirmed":false,"repo":{"name":"google/shieldgemma-2-4b-it","type":"model"},"discussionRole":0,"acceptLanguages":["en","*"],"disableDiscussionClosingAndCommentHiding":false,"hideComments":true}">

I followed the usage part on the model card page, but the import error occurred.

I founded that transformers v4.49.0-Gemma-3 branch does NOT contain the class ShieldGemmaForImageClassification. What's the correct transformers version for this model?

Google org

To use Gemma-3 models, you need the latest development version of the Transformers library (4.50.0.dev0). You can install it directly from the GitHub branch using: pip install git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3 as mentioned here.

@Renu11 Thank you! But I did install that version of the transformers by following the instructions on the Model Card. I also checked the source code and found ShieldGemmaForImageClassification does not exist.

@Renu11

$ pip install git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3

Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: http://pypiproxy.xxx:8080/simple
Collecting git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3
  Cloning https://github.com/huggingface/transformers (to revision v4.49.0-Gemma-3) to /tmp/pip-req-build-7bx5foet
  Running command git clone --filter=blob:none --quiet https://github.com/huggingface/transformers /tmp/pip-req-build-7bx5foet
  Running command git checkout -q 1c0f782fe5f983727ff245c4c1b3906f9b99eec2
  Resolved https://github.com/huggingface/transformers to commit 1c0f782fe5f983727ff245c4c1b3906f9b99eec2
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: filelock in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (3.13.4)
Requirement already satisfied: huggingface-hub<1.0,>=0.26.0 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.29.3)
Requirement already satisfied: numpy>=1.17 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (1.22.4)
Requirement already satisfied: packaging>=20.0 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (24.0)
Requirement already satisfied: pyyaml>=5.1 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (6.0.1)
Requirement already satisfied: regex!=2019.12.17 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (2024.11.6)
Requirement already satisfied: requests in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (2.31.0)
Requirement already satisfied: tokenizers<0.22,>=0.21 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.21.0)
Requirement already satisfied: safetensors>=0.4.1 in /home/jovyan/.local/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (0.5.2)
Requirement already satisfied: tqdm>=4.27 in /opt/conda/lib/python3.10/site-packages (from transformers==4.50.0.dev0) (4.64.1)
Requirement already satisfied: fsspec>=2023.5.0 in /home/jovyan/.local/lib/python3.10/site-packages (from huggingface-hub<1.0,>=0.26.0->transformers==4.50.0.dev0) (2024.12.0)
Requirement already satisfied: typing-extensions>=3.7.4.3 in /home/jovyan/.local/lib/python3.10/site-packages (from huggingface-hub<1.0,>=0.26.0->transformers==4.50.0.dev0) (4.12.2)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/jovyan/.local/lib/python3.10/site-packages (from requests->transformers==4.50.0.dev0) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /home/jovyan/.local/lib/python3.10/site-packages (from requests->transformers==4.50.0.dev0) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in /home/jovyan/.local/lib/python3.10/site-packages (from requests->transformers==4.50.0.dev0) (1.26.11)
Requirement already satisfied: certifi>=2017.4.17 in /home/jovyan/.local/lib/python3.10/site-packages (from requests->transformers==4.50.0.dev0) (2024.2.2)
Building wheels for collected packages: transformers
  Building wheel for transformers (pyproject.toml) ... done
  Created wheel for transformers: filename=transformers-4.50.0.dev0-py3-none-any.whl size=10936429 sha256=d192084136fb29c56ac7366435089fab7699866f1ffcefdeb3ae35702bb11dc3
  Stored in directory: /tmp/pip-ephem-wheel-cache-lyy5dd1u/wheels/c1/95/d1/7d800368ab25942bf88f88fe1716597fcc8d757043c9b48a2f
Successfully built transformers
Installing collected packages: transformers
Successfully installed transformers-4.50.0.dev0

And then still getting

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 3
      1 # pip install accelerate
----> 3 from transformers import AutoProcessor, ShieldGemmaForImageClassification
      4 from PIL import Image
      5 import requests

ImportError: cannot import name 'ShieldGemmaForImageClassification' from 'transformers'

the same question, I have installed dev transformers by git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3, but it doesn't work

image.png

Thank you for bringing this issue to our attention. We are currently investigating it.

Hi @BITDDD ! I'm the ShieldGemma technical lead and the problem you're having is because the model class is still being reviewed and integrated into Transformers. We had intended to land both PRs at the same time but ran into some process hiccups yesterday. It's expected to land later today. Follow along here: https://github.com/huggingface/transformers/pull/36678

@RyanMullins

I was curious, so I immediately accepted the PR and installed it.

pip install git+https://github.com/RyanMullins/transformers.git@shieldgemma2

It still didn't work as described in the Model Card.
After reading the PR, I found that it's ShieldGemma2ForImageClassification, not ShieldGemmaForImageClassification

Everything is working well now—thanks for the PR!

Your need to confirm your account before you can post a new comment.

Sign up or log in to comment