Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
| 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 |
-
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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()
|