MJobe commited on
Commit
36dea63
1 Parent(s): 2a6ae74

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +10 -0
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
+ )