Update app.py
Browse files
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 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
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))
|