multimodalart HF staff commited on
Commit
4ea677e
1 Parent(s): 928203d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -161,8 +161,9 @@ 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
- print("Entrou?")
 
166
  answer = answer.replace('"', '\\"').replace("'", '"')
167
  print(f"Caption: {answer}")
168
  parsed_answer = json.loads(answer)
 
161
  api_name="/process_image"
162
  )[0]
163
  print(f"Caption: {answer}")
164
+ if(answer.startswith(''''<DETAILED_CAPTION>': "''')):
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)