From 6787d0a5f4ef0758187c31266b4d7ce31e50f620 Mon Sep 17 00:00:00 2001 From: Beat Buesser Date: Thu, 7 Dec 2023 17:34:37 +0100 Subject: [PATCH] Update workflows for PyTorch 2.x Signed-off-by: Beat Buesser --- .github/actions/deepspeech-v3/Dockerfile | 3 +++ .github/workflows/ci-style-checks.yml | 4 ++-- art/defences/transformer/poisoning/strip.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/actions/deepspeech-v3/Dockerfile b/.github/actions/deepspeech-v3/Dockerfile index 151a0e0795..89ecadb38e 100644 --- a/.github/actions/deepspeech-v3/Dockerfile +++ b/.github/actions/deepspeech-v3/Dockerfile @@ -18,6 +18,7 @@ RUN apt-get update \ libsndfile-dev \ libsndfile1 \ vim \ + curl \ && apt-get clean all \ && rm -r /var/lib/apt/lists/* @@ -30,3 +31,5 @@ RUN cd deepspeech.pytorch && sed -i '/^sklearn/d' requirements.txt && pip instal RUN pip install numba==0.56.4 pytest-cov==4.1.0 pydub==0.25.1 RUN pip list + +RUN mkdir -p /root/.art/data && cd /root/.art/data && curl -LJO "https://github.com/SeanNaren/deepspeech.pytorch/releases/download/V3.0/librispeech_pretrained_v3.ckpt" diff --git a/.github/workflows/ci-style-checks.yml b/.github/workflows/ci-style-checks.yml index 3a9955e2b9..636dc6a7f0 100644 --- a/.github/workflows/ci-style-checks.yml +++ b/.github/workflows/ci-style-checks.yml @@ -31,7 +31,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: '3.10' - name: Pre-install run: | sudo apt-get update @@ -39,7 +39,7 @@ jobs: - name: Install Dependencies run: | python -m pip install --upgrade pip setuptools wheel - pip install -q pylint==2.12.2 mypy==0.931 pycodestyle==2.8.0 black==21.12b0 + pip install -q pylint==2.12.2 mypy==1.7.1 pycodestyle==2.8.0 black==21.12b0 pip install -q -r <(sed '/^numpy/d;/^pluggy/d;/^tensorflow/d;/^keras/d' requirements_test.txt) pip install numpy==1.22.4 pip install pluggy==0.13.1 diff --git a/art/defences/transformer/poisoning/strip.py b/art/defences/transformer/poisoning/strip.py index d34c85dbe8..40cac3ace9 100644 --- a/art/defences/transformer/poisoning/strip.py +++ b/art/defences/transformer/poisoning/strip.py @@ -61,7 +61,7 @@ def __call__( # type: ignore self, num_samples: int = 20, false_acceptance_rate: float = 0.01, - ) -> CLASSIFIER_TYPE: + ) -> "CLASSIFIER_TYPE": """ Create a STRIP defense