Spaces:
Sleeping
Sleeping
Commit
•
d1fed35
1
Parent(s):
4ea677e
Update app.py
Browse files
app.py
CHANGED
@@ -161,9 +161,11 @@ def run_captioning_spaces(images, concept_sentence, *captions):
|
|
161 |
api_name="/process_image"
|
162 |
)[0]
|
163 |
print(f"Caption: {answer}")
|
164 |
-
if(answer.startswith('
|
|
|
165 |
answer = answer.replace("'<DETAILED_CAPTION>'", '"<DETAILED_CAPTION>"')
|
166 |
else:
|
|
|
167 |
answer = answer.replace('"', '\\"').replace("'", '"')
|
168 |
print(f"Caption: {answer}")
|
169 |
parsed_answer = json.loads(answer)
|
|
|
161 |
api_name="/process_image"
|
162 |
)[0]
|
163 |
print(f"Caption: {answer}")
|
164 |
+
if(answer.startswith("'<DETAILED_CAPTION>': \"")):
|
165 |
+
print("enter detailed")
|
166 |
answer = answer.replace("'<DETAILED_CAPTION>'", '"<DETAILED_CAPTION>"')
|
167 |
else:
|
168 |
+
print("enter normal")
|
169 |
answer = answer.replace('"', '\\"').replace("'", '"')
|
170 |
print(f"Caption: {answer}")
|
171 |
parsed_answer = json.loads(answer)
|