Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,10 +49,11 @@ def load_models():
|
|
| 49 |
pipeline.safety_checker = None
|
| 50 |
print("✅ NSFW filter disabled", file=sys.stderr)
|
| 51 |
|
|
|
|
| 52 |
# Alternative: Replace safety checker with dummy function
|
| 53 |
if hasattr(pipeline, 'run_safety_checker'):
|
| 54 |
-
def dummy_safety_checker(
|
| 55 |
-
return
|
| 56 |
pipeline.run_safety_checker = dummy_safety_checker
|
| 57 |
print("✅ Safety checker replaced with dummy", file=sys.stderr)
|
| 58 |
|
|
|
|
| 49 |
pipeline.safety_checker = None
|
| 50 |
print("✅ NSFW filter disabled", file=sys.stderr)
|
| 51 |
|
| 52 |
+
# Alternative: Replace safety checker with dummy function
|
| 53 |
# Alternative: Replace safety checker with dummy function
|
| 54 |
if hasattr(pipeline, 'run_safety_checker'):
|
| 55 |
+
def dummy_safety_checker(image, *args, **kwargs):
|
| 56 |
+
return image, False
|
| 57 |
pipeline.run_safety_checker = dummy_safety_checker
|
| 58 |
print("✅ Safety checker replaced with dummy", file=sys.stderr)
|
| 59 |
|