JohanBeytell commited on
Commit
1c7206a
·
verified ·
1 Parent(s): 5cdd7c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -101,20 +101,20 @@ def generate_random_name(interpreter, vocab_size, sp, max_length=10, temperature
101
 
102
  def generateNames(type, amount, max_length=30, temperature=0.5, seed_text=""):
103
  hate_speech = detect_hate_speech(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:
111
- if hate_speech == ['Hate Speech']:
112
- gr.Warning('Hate speech detected in the seed text, using an empty seed text.')
113
- seed_text = ''
114
- elif hate_speech == ['Offensive Speech']:
115
- gr.Warning('Offensive speech detected in the seed text, using an empty seed text.')
116
- seed_text = ''
117
- # elif hate_speech == ['No Hate and Offensive Speech']:
118
 
119
  if type == "Terraria":
120
  max_seq_len = 12 # For skyrim = 13, for terraria = 12
 
101
 
102
  def generateNames(type, amount, max_length=30, temperature=0.5, seed_text=""):
103
  hate_speech = detect_hate_speech(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:
111
+ if hate_speech == ['Hate Speech']:
112
+ gr.Warning('Hate speech detected in the seed text, using an empty seed text.')
113
+ seed_text = ''
114
+ elif hate_speech == ['Offensive Speech']:
115
+ gr.Warning('Offensive speech detected in the seed text, using an empty seed text.')
116
  seed_text = ''
117
+ # elif hate_speech == ['No Hate and Offensive Speech']:
 
 
 
 
 
 
 
118
 
119
  if type == "Terraria":
120
  max_seq_len = 12 # For skyrim = 13, for terraria = 12