Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -93,7 +93,7 @@ def tag_image(pil_image: Image.Image, output_format: str) -> str:
|
|
93 |
tag_list.sort(key=lambda x: x[1], reverse=True)
|
94 |
lines.append(f"**Category: {cat}** – {len(tag_list)} tags")
|
95 |
for tag, prob in tag_list:
|
96 |
-
tag_pretty = tag.replace("_", " ")
|
97 |
lines.append(f"- {tag_pretty} (Prob: {prob:.3f})")
|
98 |
lines.append("") # blank line between categories
|
99 |
return "\n".join(lines)
|
|
|
93 |
tag_list.sort(key=lambda x: x[1], reverse=True)
|
94 |
lines.append(f"**Category: {cat}** – {len(tag_list)} tags")
|
95 |
for tag, prob in tag_list:
|
96 |
+
tag_pretty = tag.replace("_", " ").replace("(", "\\(").replace(")", "\\)") # Escape parentheses here
|
97 |
lines.append(f"- {tag_pretty} (Prob: {prob:.3f})")
|
98 |
lines.append("") # blank line between categories
|
99 |
return "\n".join(lines)
|