From 5944d9a3e1f812a577ec0d033d5c6df3b30b4363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gourieff=20=7C=20=E5=8F=A4=E4=BB=81?= Date: Fri, 21 Feb 2025 18:30:53 +0700 Subject: [PATCH] FIX: PR30 'model_path' variable name error --- scripts/reactor_sfw.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/reactor_sfw.py b/scripts/reactor_sfw.py index f91cc66..2db04a7 100644 --- a/scripts/reactor_sfw.py +++ b/scripts/reactor_sfw.py @@ -4,19 +4,18 @@ import logging import os from reactor_utils import download -def ensure_nsfw_model(model_path): +def ensure_nsfw_model(nsfwdet_model_path): """Download NSFW detection model if it doesn't exist""" - if not os.path.exists(model_path): - os.makedirs(model_path) + if not os.path.exists(nsfwdet_model_path): + os.makedirs(nsfwdet_model_path) nd_urls = [ "https://huggingface.co/AdamCodd/vit-base-nsfw-detector/resolve/main/config.json", - "https://huggingface.co/AdamCodd/vit-base-nsfw-detector/resolve/main/confusion_matrix.png", "https://huggingface.co/AdamCodd/vit-base-nsfw-detector/resolve/main/model.safetensors", "https://huggingface.co/AdamCodd/vit-base-nsfw-detector/resolve/main/preprocessor_config.json", ] for model_url in nd_urls: model_name = os.path.basename(model_url) - model_path = os.path.join(model_path, model_name) + model_path = os.path.join(nsfwdet_model_path, model_name) download(model_url, model_path, model_name) SCORE = 0.965 # 0.965 and less - is safety content