Ankit93 commited on
Commit
4d5ba42
·
verified ·
1 Parent(s): e149839

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
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
- bytes_data = uploaded_file.getvalue()
36
- image_parts = [{
37
- "mime_type":uploaded_file.type,
38
- "data":bytes_data
39
- }]
40
- return image_parts
 
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)