Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -207,10 +207,10 @@ def create_label_single_pass(background_image, model_data, final_size=(520, 728)
|
|
| 207 |
|
| 208 |
# Capitalize only the first letter of the first word while keeping the rest as is
|
| 209 |
def smart_capitalize(text):
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
|
| 215 |
# Apply smart capitalization
|
| 216 |
provider_text = smart_capitalize(str(model_data['provider']))
|
|
|
|
| 207 |
|
| 208 |
# Capitalize only the first letter of the first word while keeping the rest as is
|
| 209 |
def smart_capitalize(text):
|
| 210 |
+
"""Capitalizes the first letter of a string only if it's not already capitalized."""
|
| 211 |
+
if not text:
|
| 212 |
+
return text # Return unchanged if empty
|
| 213 |
+
return text if text[0].isupper() else text[0].upper() + text[1:]
|
| 214 |
|
| 215 |
# Apply smart capitalization
|
| 216 |
provider_text = smart_capitalize(str(model_data['provider']))
|