yashbyname commited on
Commit
b7a156f
·
verified ·
1 Parent(s): d124043

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -94,7 +94,7 @@ def extract_json_from_answer(answer, image_analysis):
94
  end_idx = answer.rfind('}')
95
  if start_idx != -1 and end_idx != 0:
96
  json_str = answer[start_idx:end_idx]
97
- json_str += f"image_analysis: ['prediction': {image_analysis['prediction']}, 'confidence': {image_analysis['confidence']}%.]"
98
  return json.loads(json_str)
99
  except (json.JSONDecodeError, ValueError):
100
  logger.error("Failed to parse JSON from response")
 
94
  end_idx = answer.rfind('}')
95
  if start_idx != -1 and end_idx != 0:
96
  json_str = answer[start_idx:end_idx]
97
+ json_str += f",image_analysis: ['prediction': {image_analysis['prediction']}, 'confidence': {image_analysis['confidence']}%.]"
98
  return json.loads(json_str)
99
  except (json.JSONDecodeError, ValueError):
100
  logger.error("Failed to parse JSON from response")