Skip to content

Update dependency transformers to v4.38.0 [SECURITY]#69

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/pypi-transformers-vulnerability
Open

Update dependency transformers to v4.38.0 [SECURITY]#69
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/pypi-transformers-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Dec 20, 2023

Copy link
Copy Markdown
Contributor

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
transformers 4.30.24.38.0 age confidence
transformers ==4.30.2==4.38.0 age confidence

transformers has a Deserialization of Untrusted Data vulnerability

CVE-2023-7018 / GHSA-v68g-wm8c-6x7j

More information

Details

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36.

Severity

  • CVSS Score: 7.8 / 10 (High)
  • Vector String: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


transformers has a Deserialization of Untrusted Data vulnerability

CVE-2023-6730 / GHSA-3863-2447-669p

More information

Details

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36.0.

Severity

  • CVSS Score: 9.0 / 10 (Critical)
  • Vector String: CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Transformers Deserialization of Untrusted Data vulnerability

CVE-2024-3568 / GHSA-37q5-v5qm-c9v8

More information

Details

The huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data within the load_repo_checkpoint() function of the TFPreTrainedModel() class. Attackers can execute arbitrary code and commands by crafting a malicious serialized payload, exploiting the use of pickle.load() on data from potentially untrusted sources. This vulnerability allows for remote code execution (RCE) by deceiving victims into loading a seemingly harmless checkpoint during a normal training process, thereby enabling attackers to execute arbitrary code on the targeted machine.

Severity

  • CVSS Score: 3.4 / 10 (Low)
  • Vector String: CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:N/A:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

huggingface/transformers (transformers)

v4.38.0: v4.38: Gemma, Depth Anything, Stable LM; Static Cache, HF Quantizer, AQLM

Compare Source

New model additions

💎 Gemma 💎

Gemma is a new opensource Language Model series from Google AI that comes with a 2B and 7B variant. The release comes with the pre-trained and instruction fine-tuned versions and you can use them via AutoModelForCausalLM, GemmaForCausalLM or pipeline interface!

Read more about it in the Gemma release blogpost: https://hf.co/blog/gemma

from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b")
model = AutoModelForCausalLM.from_pretrained("google/gemma-2b", device_map="auto", torch_dtype=torch.float16)

input_text = "Write me a poem about Machine Learning."
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")

outputs = model.generate(**input_ids)

You can use the model with Flash Attention, SDPA, Static cache and quantization API for further optimizations !

  • Flash Attention 2
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b")

model = AutoModelForCausalLM.from_pretrained(
    "google/gemma-2b", device_map="auto", torch_dtype=torch.float16, attn_implementation="flash_attention_2"
)

input_text = "Write me a poem about Machine Learning."
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")

outputs = model.generate(**input_ids)
  • bitsandbytes-4bit
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b")

model = AutoModelForCausalLM.from_pretrained(
    "google/gemma-2b", device_map="auto", load_in_4bit=True
)

input_text = "Write me a poem about Machine Learning."
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")

outputs = model.generate(**input_ids)
  • Static Cache
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b")

model = AutoModelForCausalLM.from_pretrained(
    "google/gemma-2b", device_map="auto"
)

model.generation_config.cache_implementation = "static"

input_text = "Write me a poem about Machine Learning."
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")

outputs = model.generate(**input_ids)
Depth Anything Model

The Depth Anything model was proposed in Depth Anything: Unleashing the Power of Large-Scale Unlabeled Data by Lihe Yang, Bingyi Kang, Zilong Huang, Xiaogang Xu, Jiashi Feng, Hengshuang Zhao. Depth Anything is based on the DPT architecture, trained on ~62 million images, obtaining state-of-the-art results for both relative and absolute depth estimation.

image

Stable LM

StableLM 3B 4E1T was proposed in StableLM 3B 4E1T: Technical Report by Stability AI and is the first model in a series of multi-epoch pre-trained language models.

StableLM 3B 4E1T is a decoder-only base language model pre-trained on 1 trillion tokens of diverse English and code datasets for four epochs. The model architecture is transformer-based with partial Rotary Position Embeddings, SwiGLU activation, LayerNorm, etc.

The team also provides StableLM Zephyr 3B, an instruction fine-tuned version of the model that can be used for chat-based applications.

⚡️ Static cache was introduced in the following PRs ⚡️

Static past key value cache allows LlamaForCausalLM' s forward pass to be compiled using torch.compile !
This means that (cuda) graphs can be used for inference, which speeds up the decoding step by 4x!
A forward pass of Llama2 7B takes around 10.5 ms to run with this on an A100! Equivalent to TGI performances! ⚡️

⚠️ Support for generate is not included yet. This feature is experimental and subject to changes in subsequent releases.

from transformers import AutoTokenizer, AutoModelForCausalLM, StaticCache
import torch
import os

### compilation triggers multiprocessing
os.environ["TOKENIZERS_PARALLELISM"] = "true"

tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf")
model = AutoModelForCausalLM.from_pretrained(
    "meta-llama/Llama-2-7b-hf",
    device_map="auto",
    torch_dtype=torch.float16
)

### set up the static cache in advance of using the model
model._setup_cache(StaticCache, max_batch_size=1, max_cache_len=128)

### trigger compilation!
compiled_model = torch.compile(model, mode="reduce-overhead", fullgraph=True)

### run the model as usual
input_text = "A few facts about the universe: "
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda").input_ids
model_outputs = compiled_model(input_ids)

Quantization

🧼 HF Quantizer 🧼

HfQuantizer makes it easy for quantization method researchers and developers to add inference and / or quantization support in 🤗 transformers. If you are interested in adding the support for new methods, please refer to this documentation page: https://huggingface.co/docs/transformers/main/en/hf_quantizer

⚡️AQLM ⚡️

AQLM is a new quantization method that enables no-performance degradation in 2-bit precision. Check out this demo about how to run Mixtral in 2-bit on a free-tier Google Colab instance: https://huggingface.co/posts/ybelkada/434200761252287

🧼 Moving canonical repositories 🧼

The canonical repositories on the hugging face hub (models that did not have an organization, like bert-base-cased), have been moved under organizations.

You can find the entire list of models moved here: https://huggingface.co/collections/julien-c/canonical-models-65ae66e29d5b422218567567

Redirection has been set up so that your code continues working even if you continue calling the previous paths. We, however, still encourage you to update your code to use the new links so that it is entirely future proof.

Flax Improvements 🚀

The Mistral model was added to the library in Flax.

TensorFlow Improvements 🚀

With Keras 3 becoming the standard version of Keras in TensorFlow 2.16, we've made some internal changes to maintain compatibility. We now have full compatibility with TF 2.16 as long as the tf-keras compatibility package is installed. We've also taken the opportunity to do some cleanup - in particular, the objects like BatchEncoding that are returned by our tokenizers and processors can now be directly passed to Keras methods like model.fit(), which should simplify a lot of code and eliminate a long-standing source of annoyances.

Pre-Trained backbone weights 🚀

Enable loading in pretrained backbones in a new model, where all other weights are randomly initialized. Note: validation checks are still in place when creating a config. Passing in use_pretrained_backbone will raise an error. You can override by setting
config.use_pretrained_backbone = True after creating a config. However, it is not yet guaranteed to be fully backwards compatible.

from transformers import MaskFormerConfig, MaskFormerModel

config = MaskFormerConfig(
	use_pretrained_backbone=False, 
	backbone="microsoft/resnet-18"
)
config.use_pretrained_backbone = True

### Both models have resnet-18 backbone weights and all other weights randomly
### initialized 
model_1 = MaskFormerModel(config)
model_2 = MaskFormerModel(config)

Introduce a helper function load_backbone to load a backbone from a backbone's model config e.g. ResNetConfig, or from a model config which contains backbone information. This enables cleaner modeling files and crossloading between timm and transformers backbones.

from transformers import ResNetConfig, MaskFormerConfig
from transformers.utils.backbone_utils import load_backbone

### Resnet defines the backbone model to load
config = ResNetConfig()
backbone = load_backbone(config)

### Maskformer config defines a model which uses a resnet backbone
config = MaskFormerConfig(use_timm_backbone=True, backbone="resnet18")
backbone = load_backbone(config)

config = MaskFormerConfig(backbone_config=ResNetConfig())
backbone = load_backbone(config)

Add in API references, list supported backbones, updated examples, clarification and moving information to better reflect usage and docs

Image Processor work 🚀

Bugfixes and improvements 🚀

Note

PR body was truncated to here.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • ""
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot force-pushed the renovate/pypi-transformers-vulnerability branch from f3dd535 to 9b7dd71 Compare April 11, 2024 00:43
@renovate renovate Bot changed the title Update dependency transformers to v4.36.0 [SECURITY] Update dependency transformers to v4.38.0 [SECURITY] Apr 11, 2024
@renovate renovate Bot force-pushed the renovate/pypi-transformers-vulnerability branch from 9b7dd71 to 486af17 Compare August 6, 2024 08:19
@renovate renovate Bot force-pushed the renovate/pypi-transformers-vulnerability branch from 486af17 to 4bbba66 Compare August 17, 2024 02:16
@renovate renovate Bot force-pushed the renovate/pypi-transformers-vulnerability branch 3 times, most recently from 8d749db to fe78466 Compare November 3, 2024 14:09
@renovate renovate Bot force-pushed the renovate/pypi-transformers-vulnerability branch from fe78466 to d86aa9e Compare January 14, 2025 13:43
@renovate renovate Bot force-pushed the renovate/pypi-transformers-vulnerability branch from d86aa9e to 6fdfded Compare January 30, 2025 19:19
@renovate renovate Bot force-pushed the renovate/pypi-transformers-vulnerability branch from 6fdfded to a2f6844 Compare March 3, 2025 18:00
@renovate renovate Bot force-pushed the renovate/pypi-transformers-vulnerability branch 2 times, most recently from 7c99d24 to 19b7ac6 Compare March 17, 2025 18:36
@renovate renovate Bot force-pushed the renovate/pypi-transformers-vulnerability branch from 19b7ac6 to c67eb3c Compare April 8, 2025 14:44
@renovate renovate Bot force-pushed the renovate/pypi-transformers-vulnerability branch from c67eb3c to fc5c460 Compare May 7, 2025 14:11
@renovate renovate Bot force-pushed the renovate/pypi-transformers-vulnerability branch 2 times, most recently from f8ec211 to 0e1996b Compare August 13, 2025 12:01
@renovate renovate Bot changed the title Update dependency transformers to v4.38.0 [SECURITY] Update dependency transformers to v4.53.0 [SECURITY] Aug 13, 2025
@renovate renovate Bot force-pushed the renovate/pypi-transformers-vulnerability branch from 0e1996b to 79360ef Compare August 19, 2025 19:05
@renovate renovate Bot force-pushed the renovate/pypi-transformers-vulnerability branch from 79360ef to e88cf17 Compare October 16, 2025 01:07
@renovate renovate Bot changed the title Update dependency transformers to v4.53.0 [SECURITY] Update dependency transformers to v4.38.0 [SECURITY] Oct 16, 2025
@renovate

renovate Bot commented Oct 16, 2025

Copy link
Copy Markdown
Contributor Author

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: poetry.lock
Updating dependencies
Resolving dependencies...

The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead.

Package pandas-ta (0.3.14b0) not found.

@renovate renovate Bot changed the title Update dependency transformers to v4.38.0 [SECURITY] Update dependency transformers to v4.38.0 [SECURITY] - autoclosed Apr 27, 2026
@renovate renovate Bot closed this Apr 27, 2026
@renovate renovate Bot deleted the renovate/pypi-transformers-vulnerability branch April 27, 2026 17:35
@renovate renovate Bot changed the title Update dependency transformers to v4.38.0 [SECURITY] - autoclosed Update dependency transformers to v4.38.0 [SECURITY] Apr 27, 2026
@renovate renovate Bot reopened this Apr 27, 2026
@renovate renovate Bot force-pushed the renovate/pypi-transformers-vulnerability branch 2 times, most recently from e88cf17 to 075d2d9 Compare April 27, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants