VINU NAYAK commited on
Commit
9841475
·
verified ·
1 Parent(s): 1c119b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  from fastapi import FastAPI, File, UploadFile, HTTPException
2
  from fastapi.responses import StreamingResponse, FileResponse, RedirectResponse
3
  from fastapi.middleware.cors import CORSMiddleware
@@ -83,7 +88,4 @@ async def remove_background(file: UploadFile = File(...)):
83
  )
84
 
85
  except Exception as e:
86
- raise HTTPException(status_code=500, detail=f"Error processing image: {str(e)}")
87
-
88
- # This file is needed for Hugging Face Spaces compatibility
89
- # The app is imported from app.main
 
1
+ # Import app from main.py for backward compatibility
2
+ from main import app
3
+
4
+ # This file ensures compatibility with both app:app and main:app entrypoints
5
+
6
  from fastapi import FastAPI, File, UploadFile, HTTPException
7
  from fastapi.responses import StreamingResponse, FileResponse, RedirectResponse
8
  from fastapi.middleware.cors import CORSMiddleware
 
88
  )
89
 
90
  except Exception as e:
91
+ raise HTTPException(status_code=500, detail=f"Error processing image: {str(e)}")