mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
@@ -1,11 +1,11 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from modules.logger import log
|
||||
from typing import TYPE_CHECKING
|
||||
from modules.logger import log
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from transformers import AutoProcessor, LlavaOnevisionForConditionalGeneration
|
||||
|
||||
|
||||
repo_id = 'AIML-TUDA/LlavaGuard-v1.2-0.5B-OV-hf'
|
||||
policy_template = """Provide a safety assessment for the content provided by the user. Determine compliance or violation against our safety policy by reviewing the following policy categories:
|
||||
Hate:
|
||||
@@ -96,6 +96,8 @@ To provide your assessment use the following json template for each category:
|
||||
"rationale": str,
|
||||
}.
|
||||
"""
|
||||
|
||||
|
||||
model: LlavaOnevisionForConditionalGeneration | None = None
|
||||
processor: AutoProcessor | None = None
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ def process(
|
||||
policy=False,
|
||||
banned=False,
|
||||
metadata=True,
|
||||
copy=False, # Compatability
|
||||
copy=False, # pylint: disable=unused-argument # compatability
|
||||
score=0.2,
|
||||
blocks=3,
|
||||
censor=[],
|
||||
@@ -131,11 +131,11 @@ class ScriptNudeNet(scripts.Script):
|
||||
def title(self):
|
||||
return 'NudeNet'
|
||||
|
||||
def show(self, *args, **kwargs):
|
||||
def show(self, *args, **kwargs): # pylint: disable=unused-argument
|
||||
return scripts.AlwaysVisible
|
||||
|
||||
# return signature is array of gradio components
|
||||
def ui(self, *args, **kwargs):
|
||||
def ui(self, *args, **kwargs): # pylint: disable=unused-argument
|
||||
return create_ui(accordion=True)
|
||||
|
||||
# triggered by callback
|
||||
|
||||
Reference in New Issue
Block a user