Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for censorship label bug #454

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions horde/classes/stable/processing_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,15 @@ def log_aborted_generation(self):

def set_generation(self, generation, things_per_sec, **kwargs):
state = kwargs.get("state", "ok")
for metadata in kwargs.get("gen_metadata", []):
if metadata.get('value') == 'csam':
state = 'csam'
gen_metadata = kwargs.get("gen_metadata") or []
for metadata in gen_metadata:
if metadata.get("type") != "censorship":
# this metadata isnt about censorship
continue
if metadata.get("value") == "csam":
state = "csam"
else:
state = 'censored'
state = "censored"
if state in ["censored", "csam"]:
self.censored = True
db.session.commit()
Expand Down
Loading