ura23 commited on
Commit
bfe2156
·
verified ·
1 Parent(s): e3c9e7b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -292,9 +292,17 @@ def main():
292
  # Generate formatted output
293
  prompts = []
294
  for i, (general_tags, character_tags) in enumerate(results):
295
- # Construct the prompt based on the presence of character_tags
296
- if character_tags:
297
- prompts.append(f"{character_tags}, {general_part}")
 
 
 
 
 
 
 
 
298
  else:
299
  prompts.append(general_part)
300
 
 
292
  # Generate formatted output
293
  prompts = []
294
  for i, (general_tags, character_tags) in enumerate(results):
295
+ # Replace underscores with spaces for both character and general tags
296
+ character_part = ", ".join(
297
+ tag.replace('_', ' ') for tag in character_tags if tag.lower() not in filter_set
298
+ )
299
+ general_part = ", ".join(
300
+ tag.replace('_', ' ') for tag in general_tags if tag.lower() not in filter_set
301
+ )
302
+
303
+ # Construct the prompt based on the presence of character_part
304
+ if character_part:
305
+ prompts.append(f"{character_part}, {general_part}")
306
  else:
307
  prompts.append(general_part)
308