File size: 346 Bytes
a6e5763
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
import os
import subprocess

if __name__ == "__main__":
    try:
        # Run the Flask app using Gunicorn with 4 worker processes
        subprocess.run(["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "myapp:myapp"], check=True)
    except subprocess.CalledProcessError as e:
        print(f"An error occurred while running the application: {e}")