From bcd2deb49b877575db02abc76544736e4218f86f Mon Sep 17 00:00:00 2001 From: Arthur Zucker Date: Thu, 2 May 2024 13:47:12 +0200 Subject: [PATCH] fix tf tapas --- docker/examples-torch.dockerfile | 2 +- src/transformers/models/tapas/modeling_tf_tapas.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docker/examples-torch.dockerfile b/docker/examples-torch.dockerfile index 43a6bab32f9470..888e30f5eaa033 100644 --- a/docker/examples-torch.dockerfile +++ b/docker/examples-torch.dockerfile @@ -6,6 +6,6 @@ ENV VIRTUAL_ENV=/usr/local RUN pip --no-cache-dir install uv && uv venv && uv pip install --no-cache-dir -U pip setuptools RUN pip install --no-cache-dir 'torch' 'torchvision' 'torchaudio' --index-url https://download.pytorch.org/whl/cpu RUN uv pip install --no-deps timm accelerate --extra-index-url https://download.pytorch.org/whl/cpu -RUN uv pip install --no-cache-dir librosa "transformers[sklearn,sentencepiece,vision,testing]" seqeval +RUN uv pip install --no-cache-dir librosa "transformers[sklearn,sentencepiece,vision,testing]" seqeval albumentations RUN pip uninstall -y transformers RUN apt-get clean && rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/src/transformers/models/tapas/modeling_tf_tapas.py b/src/transformers/models/tapas/modeling_tf_tapas.py index baf0880309ab99..2a3281cc439327 100644 --- a/src/transformers/models/tapas/modeling_tf_tapas.py +++ b/src/transformers/models/tapas/modeling_tf_tapas.py @@ -62,7 +62,7 @@ try: import tensorflow_probability as tfp - # On the first call, check whether a compatible version of TensorFlow is installed + # On the first call, check whether a compatible version of TensorFlow is instalTFTapasMainLayerled # TensorFlow Probability depends on a recent stable release of TensorFlow n = tfp.distributions.Normal(loc=0.0, scale=1.0) except ImportError: @@ -839,7 +839,6 @@ class TFTapasMainLayer(keras.layers.Layer): config_class = TapasConfig def __init__(self, config: TapasConfig, add_pooling_layer: bool = True, **kwargs): - requires_backends(self, "tensorflow_probability") super().__init__(**kwargs) self.config = config