wilwork commited on
Commit
6ae178b
·
verified ·
1 Parent(s): 1d65703

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -17,12 +17,12 @@ def compute_similarity(input1_type, input1_text, input1_image, input2_type, inpu
17
  # Validate inputs
18
  if input1_type == "Text" and not input1_text.strip():
19
  return "Error: Input 1 is empty!"
20
- if input1_type == "Image" and input1_image is None:
21
  return "Error: Please upload an image for Input 1!"
22
 
23
  if input2_type == "Text" and not input2_text.strip():
24
  return "Error: Input 2 is empty!"
25
- if input2_type == "Image" and input2_image is None:
26
  return "Error: Please upload an image for Input 2!"
27
 
28
  try:
 
17
  # Validate inputs
18
  if input1_type == "Text" and not input1_text.strip():
19
  return "Error: Input 1 is empty!"
20
+ if input1_type == "Image" and (input1_image is None or isinstance(input1_image, bool)):
21
  return "Error: Please upload an image for Input 1!"
22
 
23
  if input2_type == "Text" and not input2_text.strip():
24
  return "Error: Input 2 is empty!"
25
+ if input2_type == "Image" and (input2_image is None or isinstance(input2_image, bool)):
26
  return "Error: Please upload an image for Input 2!"
27
 
28
  try: