Spaces:
Running
on
Zero
Running
on
Zero
Update src/app/response.py
Browse files- src/app/response.py +1 -1
src/app/response.py
CHANGED
@@ -50,7 +50,7 @@ def caption_image(image: PIL.Image.Image, max_new_tokens: int) -> str:
|
|
50 |
logging.info("Caption generated successfully.")
|
51 |
|
52 |
# Return the generated caption
|
53 |
-
return result[0][len(
|
54 |
|
55 |
# Handle exceptions that may occur during caption generation
|
56 |
except Exception as e:
|
|
|
50 |
logging.info("Caption generated successfully.")
|
51 |
|
52 |
# Return the generated caption
|
53 |
+
return result[0][len(prompt) :].lstrip("\n")
|
54 |
|
55 |
# Handle exceptions that may occur during caption generation
|
56 |
except Exception as e:
|