Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -104,7 +104,7 @@ def generateNames(type, amount, max_length=30, temperature=0.5, seed_text=""):
|
|
104 |
profanity = detect_profanity([seed_text], language='All')
|
105 |
output = ''
|
106 |
|
107 |
-
if profanity > 0:
|
108 |
gr.Warning("Profanity detected in the seed text, using an empty seed text.")
|
109 |
seed_text = ''
|
110 |
else:
|
@@ -140,7 +140,7 @@ def generateNames(type, amount, max_length=30, temperature=0.5, seed_text=""):
|
|
140 |
profanity = detect_profanity([stripped], language='All')
|
141 |
name = ''
|
142 |
|
143 |
-
if profanity > 0:
|
144 |
name = "Profanity Detected"
|
145 |
else:
|
146 |
if hate_speech == ['Hate Speech']:
|
@@ -176,7 +176,7 @@ def generateNames(type, amount, max_length=30, temperature=0.5, seed_text=""):
|
|
176 |
profanity = detect_profanity([stripped], language='All')
|
177 |
name = ''
|
178 |
|
179 |
-
if profanity > 0:
|
180 |
name = "Profanity Detected"
|
181 |
else:
|
182 |
if hate_speech == ['Hate Speech']:
|
@@ -212,7 +212,7 @@ def generateNames(type, amount, max_length=30, temperature=0.5, seed_text=""):
|
|
212 |
profanity = detect_profanity([stripped], language='All')
|
213 |
name = ''
|
214 |
|
215 |
-
if profanity > 0:
|
216 |
name = "Profanity Detected"
|
217 |
else:
|
218 |
if hate_speech == ['Hate Speech']:
|
@@ -248,7 +248,7 @@ def generateNames(type, amount, max_length=30, temperature=0.5, seed_text=""):
|
|
248 |
profanity = detect_profanity([stripped], language='All')
|
249 |
name = ''
|
250 |
|
251 |
-
if profanity > 0:
|
252 |
name = "Profanity Detected"
|
253 |
else:
|
254 |
if hate_speech == ['Hate Speech']:
|
|
|
104 |
profanity = detect_profanity([seed_text], language='All')
|
105 |
output = ''
|
106 |
|
107 |
+
if len(profanity) > 0:
|
108 |
gr.Warning("Profanity detected in the seed text, using an empty seed text.")
|
109 |
seed_text = ''
|
110 |
else:
|
|
|
140 |
profanity = detect_profanity([stripped], language='All')
|
141 |
name = ''
|
142 |
|
143 |
+
if len(profanity) > 0:
|
144 |
name = "Profanity Detected"
|
145 |
else:
|
146 |
if hate_speech == ['Hate Speech']:
|
|
|
176 |
profanity = detect_profanity([stripped], language='All')
|
177 |
name = ''
|
178 |
|
179 |
+
if len(profanity) > 0:
|
180 |
name = "Profanity Detected"
|
181 |
else:
|
182 |
if hate_speech == ['Hate Speech']:
|
|
|
212 |
profanity = detect_profanity([stripped], language='All')
|
213 |
name = ''
|
214 |
|
215 |
+
if len(profanity) > 0:
|
216 |
name = "Profanity Detected"
|
217 |
else:
|
218 |
if hate_speech == ['Hate Speech']:
|
|
|
248 |
profanity = detect_profanity([stripped], language='All')
|
249 |
name = ''
|
250 |
|
251 |
+
if len(profanity) > 0:
|
252 |
name = "Profanity Detected"
|
253 |
else:
|
254 |
if hate_speech == ['Hate Speech']:
|