Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,12 +32,13 @@ if uploaded_file is not None:
|
|
| 32 |
submit = st.button("Extract Information about this image")
|
| 33 |
input_prompt = "We are uploading an image and you will have to answer any questions based on image"
|
| 34 |
def input_image_details(uploaded_file):
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
| 41 |
if submit:
|
| 42 |
image_data = input_image_details(uploaded_file)
|
| 43 |
resp = geminin_response(input_prompt,image_data,input)
|
|
|
|
| 32 |
submit = st.button("Extract Information about this image")
|
| 33 |
input_prompt = "We are uploading an image and you will have to answer any questions based on image"
|
| 34 |
def input_image_details(uploaded_file):
|
| 35 |
+
if uploaded_file:
|
| 36 |
+
bytes_data = uploaded_file.getvalue()
|
| 37 |
+
image_parts = [{
|
| 38 |
+
"mime_type":uploaded_file.type,
|
| 39 |
+
"data":bytes_data
|
| 40 |
+
}]
|
| 41 |
+
return image_parts
|
| 42 |
if submit:
|
| 43 |
image_data = input_image_details(uploaded_file)
|
| 44 |
resp = geminin_response(input_prompt,image_data,input)
|