Skip to content

Commit

Permalink
refactor: resolve CLIPFeatureExtractor deprecation warning (#152)
Browse files Browse the repository at this point in the history
This commit resolves a CLIPFeatureExtractor deprecation warning thrown
by the NSFW check logic.
  • Loading branch information
rickstaa authored Aug 13, 2024
1 parent eeef4c4 commit 0433c97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
4 changes: 2 additions & 2 deletions runner/app/pipelines/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from diffusers.pipelines.stable_diffusion import StableDiffusionSafetyChecker
from PIL import Image
from torch import dtype as TorchDtype
from transformers import CLIPFeatureExtractor
from transformers import CLIPImageProcessor
from typing import Dict

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -147,7 +147,7 @@ def __init__(
self._safety_checker = StableDiffusionSafetyChecker.from_pretrained(
"CompVis/stable-diffusion-safety-checker"
).to(self.device)
self._feature_extractor = CLIPFeatureExtractor.from_pretrained(
self._feature_extractor = CLIPImageProcessor.from_pretrained(
"openai/clip-vit-base-patch32"
)

Expand Down
12 changes: 0 additions & 12 deletions runner/test_prompts.py

This file was deleted.

0 comments on commit 0433c97

Please sign in to comment.