Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -112,3 +112,13 @@ async def pdf_question_answering(
|
|
112 |
|
113 |
except Exception as e:
|
114 |
return JSONResponse(content=f"Error processing PDF file: {str(e)}", status_code=500)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
except Exception as e:
|
114 |
return JSONResponse(content=f"Error processing PDF file: {str(e)}", status_code=500)
|
115 |
+
|
116 |
+
# Set up CORS middleware
|
117 |
+
origins = ["*"] # or specify your list of allowed origins
|
118 |
+
app.add_middleware(
|
119 |
+
CORSMiddleware,
|
120 |
+
allow_origins=origins,
|
121 |
+
allow_credentials=True,
|
122 |
+
allow_methods=["*"],
|
123 |
+
allow_headers=["*"],
|
124 |
+
)
|