sayaka1 commited on
Commit
273537b
·
verified ·
1 Parent(s): 3134fa5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -25,8 +25,9 @@ def fetch_tags(image_url):
25
  origin = data.get('tag_string_copyright', 'N/A').replace('_', ' ')
26
  tags = data.get('tag_string_general', '').replace('_', ' ')
27
 
28
- # Prepare formatted tags (comma-separated)
29
- formatted_tags = tags.replace(" ", ", ")
 
30
 
31
  # Prepare prompt with cleaned-up fields
32
  prompt = f'{character}, {origin}, {formatted_tags}'
 
25
  origin = data.get('tag_string_copyright', 'N/A').replace('_', ' ')
26
  tags = data.get('tag_string_general', '').replace('_', ' ')
27
 
28
+ # Split tags into a list and join with commas
29
+ tag_list = tags.split() # Split on whitespace to preserve multi-word tags
30
+ formatted_tags = ', '.join(tag_list) # Join with comma and space
31
 
32
  # Prepare prompt with cleaned-up fields
33
  prompt = f'{character}, {origin}, {formatted_tags}'