Abhlash commited on
Commit
386964c
·
verified ·
1 Parent(s): aff856f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  from MathEngine import calculate, CalculationRequest, app as fastapi_app
3
  import uvicorn
4
- from threading import Thread
5
 
6
  # Gradio Interface
7
  history = []
@@ -62,5 +62,9 @@ def run_fastapi():
62
  uvicorn.run(fastapi_app, host="0.0.0.0", port=8000)
63
 
64
  if __name__ == "__main__":
65
- Thread(target=run_gradio).start()
66
- Thread(target=run_fastapi).start()
 
 
 
 
 
1
  import gradio as gr
2
  from MathEngine import calculate, CalculationRequest, app as fastapi_app
3
  import uvicorn
4
+ from multiprocessing import Process
5
 
6
  # Gradio Interface
7
  history = []
 
62
  uvicorn.run(fastapi_app, host="0.0.0.0", port=8000)
63
 
64
  if __name__ == "__main__":
65
+ p1 = Process(target=run_gradio)
66
+ p2 = Process(target=run_fastapi)
67
+ p1.start()
68
+ p2.start()
69
+ p1.join()
70
+ p2.join()