Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -168,9 +168,10 @@ def get_normal_and_bible(
|
|
168 |
return ssa_name, bible_name
|
169 |
|
170 |
# --- Gradio app ---
|
171 |
-
def generate_names(n, sex, min_len, max_len, min_bible_len, max_bible_len, pop_low, pop_high, debug_flag, last
|
172 |
results = []
|
173 |
debug_output = io.StringIO()
|
|
|
174 |
with contextlib.redirect_stdout(debug_output):
|
175 |
for i in range(n):
|
176 |
try:
|
@@ -218,7 +219,7 @@ with gr.Blocks() as demo:
|
|
218 |
|
219 |
with gr.Row():
|
220 |
forbidden_names_input = gr.Textbox(label="FORBIDDEN NAMES (comma-separated)", value=FORBIDDEN_NAMES)
|
221 |
-
|
222 |
|
223 |
|
224 |
debug_checkbox = gr.Checkbox(label="Show debug output", value=True)
|
@@ -241,7 +242,7 @@ with gr.Blocks() as demo:
|
|
241 |
pop_high_slider,
|
242 |
debug_checkbox,
|
243 |
last_name_input,
|
244 |
-
|
245 |
],
|
246 |
outputs=[output_box, debug_box],
|
247 |
)
|
|
|
168 |
return ssa_name, bible_name
|
169 |
|
170 |
# --- Gradio app ---
|
171 |
+
def generate_names(n, sex, min_len, max_len, min_bible_len, max_bible_len, pop_low, pop_high, debug_flag, last, forbidden_names_text):
|
172 |
results = []
|
173 |
debug_output = io.StringIO()
|
174 |
+
forbidden_names = set(name.strip() for name in forbidden_names_text.split(",") if name.strip())
|
175 |
with contextlib.redirect_stdout(debug_output):
|
176 |
for i in range(n):
|
177 |
try:
|
|
|
219 |
|
220 |
with gr.Row():
|
221 |
forbidden_names_input = gr.Textbox(label="FORBIDDEN NAMES (comma-separated)", value=FORBIDDEN_NAMES)
|
222 |
+
|
223 |
|
224 |
|
225 |
debug_checkbox = gr.Checkbox(label="Show debug output", value=True)
|
|
|
242 |
pop_high_slider,
|
243 |
debug_checkbox,
|
244 |
last_name_input,
|
245 |
+
forbidden_names_input,
|
246 |
],
|
247 |
outputs=[output_box, debug_box],
|
248 |
)
|