Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,11 +20,13 @@ def get_caption(image_in):
|
|
| 20 |
fn_index=4
|
| 21 |
)
|
| 22 |
|
|
|
|
|
|
|
| 23 |
# Find the last occurrence of "."
|
| 24 |
-
last_period_index = kosmos2_result.rfind('.')
|
| 25 |
|
| 26 |
# Truncate the string up to the last period
|
| 27 |
-
truncated_caption = kosmos2_result[:last_period_index + 1]
|
| 28 |
|
| 29 |
# print(truncated_caption)
|
| 30 |
print(f"\n—\nIMAGE CAPTION: {truncated_caption}")
|
|
|
|
| 20 |
fn_index=4
|
| 21 |
)
|
| 22 |
|
| 23 |
+
print(f"KOSMOS2 RETURNS: {kosmos2_result}")
|
| 24 |
+
|
| 25 |
# Find the last occurrence of "."
|
| 26 |
+
last_period_index = kosmos2_result[1].rfind('.')
|
| 27 |
|
| 28 |
# Truncate the string up to the last period
|
| 29 |
+
truncated_caption = kosmos2_result[1][:last_period_index + 1]
|
| 30 |
|
| 31 |
# print(truncated_caption)
|
| 32 |
print(f"\n—\nIMAGE CAPTION: {truncated_caption}")
|