Geek7 commited on
Commit
a6e5763
·
verified ·
1 Parent(s): f57b188

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import subprocess
3
+
4
+ if __name__ == "__main__":
5
+ try:
6
+ # Run the Flask app using Gunicorn with 4 worker processes
7
+ subprocess.run(["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "myapp:myapp"], check=True)
8
+ except subprocess.CalledProcessError as e:
9
+ print(f"An error occurred while running the application: {e}")