Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -143,16 +143,16 @@ async def query(question_request: QuestionRequest):
|
|
143 |
raise HTTPException(status_code=500, detail="Internal Server Error")
|
144 |
|
145 |
|
146 |
-
|
147 |
-
|
148 |
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
|
153 |
@app.get("/")
|
154 |
async def root():
|
155 |
-
return RedirectResponse(url="
|
156 |
|
157 |
|
158 |
#if __name__ == '__main__':
|
|
|
143 |
raise HTTPException(status_code=500, detail="Internal Server Error")
|
144 |
|
145 |
|
146 |
+
def run_streamlit():
|
147 |
+
subprocess.Popen(["streamlit", "run", "frontend.py", "--server.port", "8501"])
|
148 |
|
149 |
+
@app.on_event("startup")
|
150 |
+
async def startup_event():
|
151 |
+
run_streamlit()
|
152 |
|
153 |
@app.get("/")
|
154 |
async def root():
|
155 |
+
return RedirectResponse(url="http://localhost:8501")
|
156 |
|
157 |
|
158 |
#if __name__ == '__main__':
|