From ab7857019a438958a0c5c891c22439e1c9de9ec4 Mon Sep 17 00:00:00 2001 From: Anton Lozhkov Date: Wed, 31 Aug 2022 17:57:46 +0200 Subject: [PATCH] Add missing auth tokens for two SD tests (#296) --- .github/workflows/push_tests.yml | 2 +- tests/test_pipelines.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push_tests.yml b/.github/workflows/push_tests.yml index 301114ea56..58ecc0d3c2 100644 --- a/.github/workflows/push_tests.yml +++ b/.github/workflows/push_tests.yml @@ -47,6 +47,6 @@ jobs: - name: Run all (incl. slow) tests on GPU env: - HF_API_TOKEN: ${{ secrets.HF_API_TOKEN }} + HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} run: | python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile -s tests/ diff --git a/tests/test_pipelines.py b/tests/test_pipelines.py index be3b201338..8a8319b133 100644 --- a/tests/test_pipelines.py +++ b/tests/test_pipelines.py @@ -275,7 +275,8 @@ class PipelineTesterMixin(unittest.TestCase): @unittest.skipIf(torch_device == "cpu", "Stable diffusion is supposed to run on GPU") def test_stable_diffusion(self): # make sure here that pndm scheduler skips prk - sd_pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-1").to(torch_device) + sd_pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-1", use_auth_token=True) + sd_pipe = sd_pipe.to(torch_device) prompt = "A painting of a squirrel eating a burger" generator = torch.Generator(device=torch_device).manual_seed(0) @@ -295,7 +296,8 @@ class PipelineTesterMixin(unittest.TestCase): @slow @unittest.skipIf(torch_device == "cpu", "Stable diffusion is supposed to run on GPU") def test_stable_diffusion_fast_ddim(self): - sd_pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-1").to(torch_device) + sd_pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-1", use_auth_token=True) + sd_pipe = sd_pipe.to(torch_device) scheduler = DDIMScheduler( beta_start=0.00085,