skanderovitch commited on
Commit
d739aa1
1 Parent(s): 4f12c55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -27,8 +27,8 @@ def read_root():
27
  async def extract_features(file: UploadFile = File(...)):
28
  try:
29
  # Validate file format
30
- if file.content_type not in ["image/jpeg", "image/png", "image/jpg"]:
31
- raise HTTPException(status_code=400, detail="Unsupported file format. Upload a JPEG or PNG image.")
32
 
33
  # Read image
34
  contents = await file.read()
 
27
  async def extract_features(file: UploadFile = File(...)):
28
  try:
29
  # Validate file format
30
+ if not in ["image/jpeg", "image/png", "image/jpg"]:
31
+ raise HTTPException(status_code=400, detail=f"Unsupported file format. Upload a JPEG or PNG image. Received {file.content_type}")
32
 
33
  # Read image
34
  contents = await file.read()