skanderovitch
commited on
Commit
•
d739aa1
1
Parent(s):
4f12c55
Update app.py
Browse files
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
|
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()
|