awacke1 commited on
Commit
210d6ad
1 Parent(s): 490c5c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -207,9 +207,12 @@ def process_image(image_input, user_prompt):
207
  image_input = image_file.read()
208
  SaveNewFile=False # file is there and this is just prompt inference
209
  else:
210
- image_file_name = image_input.name
211
- image_input = image_input.read()
212
- SaveNewFile=True
 
 
 
213
 
214
  st.markdown('Processing image: ' + image_file_name)
215
  base64_image = base64.b64encode(image_input).decode("utf-8")
 
207
  image_input = image_file.read()
208
  SaveNewFile=False # file is there and this is just prompt inference
209
  else:
210
+ if image_input is None:
211
+ data=False
212
+ else:
213
+ image_file_name = image_input.name
214
+ image_input = image_input.read()
215
+ SaveNewFile=True
216
 
217
  st.markdown('Processing image: ' + image_file_name)
218
  base64_image = base64.b64encode(image_input).decode("utf-8")