ajsbsd commited on
Commit
59a4329
·
verified ·
1 Parent(s): 933510e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -53,7 +53,8 @@ class PipelineManager:
53
  try:
54
  logger.info("Loading NSFW detector...")
55
  self.nsfw_detector_processor = CLIPProcessor.from_pretrained(NSFW_MODEL_ID)
56
- self.nsfw_detector_model = CLIPModel.from_pretrained(NSFW_MODEL_ID)
 
57
 
58
  if DEVICE == "cuda":
59
  self.nsfw_detector_model = self.nsfw_detector_model.to(DEVICE)
 
53
  try:
54
  logger.info("Loading NSFW detector...")
55
  self.nsfw_detector_processor = CLIPProcessor.from_pretrained(NSFW_MODEL_ID)
56
+ # Add use_safetensors=True to the CLIPModel.from_pretrained call
57
+ self.nsfw_detector_model = CLIPModel.from_pretrained(NSFW_MODEL_ID, use_safetensors=True)
58
 
59
  if DEVICE == "cuda":
60
  self.nsfw_detector_model = self.nsfw_detector_model.to(DEVICE)