diff --git a/optimum/neuron/modeling_diffusion.py b/optimum/neuron/modeling_diffusion.py index 76c07ed02..d6d0ede61 100644 --- a/optimum/neuron/modeling_diffusion.py +++ b/optimum/neuron/modeling_diffusion.py @@ -21,6 +21,7 @@ import shutil from abc import abstractmethod from collections import OrderedDict +from contextlib import contextmanager from dataclasses import asdict from pathlib import Path from tempfile import TemporaryDirectory @@ -1321,6 +1322,11 @@ def forward( outputs = (outputs,) return outputs + # Dummy context manager + @contextmanager + def cache_context(self, name: str): + yield + class NeuronModelVaeEncoder(_NeuronDiffusionModelPart): def __init__( diff --git a/pyproject.toml b/pyproject.toml index 0624bfb38..dbb926091 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,10 +61,10 @@ tests = [ "sentencepiece", "datasets", "sacremoses", - "diffusers>=0.31.0, <=0.34.0", + "diffusers==0.35.*", "safetensors", "sentence-transformers >= 2.2.0", - "peft==0.16.0", + "peft==0.17.0", "trl==0.11.4", "compel", "rjieba", @@ -75,7 +75,7 @@ tests = [ "mediapipe", "timm >= 1.0.0", "hf_transfer", - "torchcodec", + "torchcodec < 0.6.0", ] quality = [ "ruff", @@ -83,7 +83,7 @@ quality = [ ] training = [ "trl == 0.11.4", - "peft == 0.16.0", + "peft == 0.17.0", "evaluate == 0.4.3", "neuronx_distributed==0.13.14393", ] @@ -106,8 +106,8 @@ neuronx = [ "libneuronxla==2.2.4410.0", ] diffusers = [ - "diffusers>=0.31.0, <=0.34.0", - "peft==0.16.0", + "diffusers==0.35.*", + "peft==0.17.0", ] sentence-transformers = [ "sentence-transformers >= 2.2.0",