jayparmar0109 commited on
Commit
008335f
·
verified ·
1 Parent(s): 095fea1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -51,8 +51,11 @@ if submit:
51
  try:
52
  image_data = input_image_setup(uploaded_file)
53
  response = get_gemini_response(input_prompt,image_data,input)
54
- json_response = json.loads(response)
55
- st.subheader("Output :")
56
- st.write(json.dumps(json_response, indent=4))
 
 
 
57
  except FileNotFoundError as e:
58
  st.error(str(e))
 
51
  try:
52
  image_data = input_image_setup(uploaded_file)
53
  response = get_gemini_response(input_prompt,image_data,input)
54
+ try:
55
+ json_response = json.loads(response)
56
+ st.subheader("Output :")
57
+ st.write(json.dumps(json_response, indent=4))
58
+ except json.JSONDecodeError as e:
59
+ st.error(f"Invalid JSON response: {e}")
60
  except FileNotFoundError as e:
61
  st.error(str(e))