Update app.py
Browse files
app.py
CHANGED
|
@@ -6,11 +6,6 @@ import json
|
|
| 6 |
import base64
|
| 7 |
from huggingface_hub import InferenceClient, login
|
| 8 |
|
| 9 |
-
node_package = [
|
| 10 |
-
'bash', '-c',
|
| 11 |
-
'cd /home/user/app/data && npm install express @huggingface/inference dotenv'
|
| 12 |
-
]
|
| 13 |
-
|
| 14 |
if not os.path.exists("/home/user/.flag"):
|
| 15 |
subprocess.Popen("chmod +x /home/user/app/data/config_nginx.sh && chmod +x /home/user/app/data/setup.sh", shell=True, executable='/bin/bash').wait()
|
| 16 |
subprocess.Popen("curl -o- file:///home/user/app/data/config_nginx.sh | bash", shell=True, executable='/bin/bash').wait()
|
|
@@ -22,7 +17,7 @@ if not os.path.exists("/home/user/.flag"):
|
|
| 22 |
node_version_dir = subprocess.check_output("ls ~/.nvm/versions/node", shell=True, executable='/bin/bash').strip().decode('utf-8')
|
| 23 |
node_path = f"/home/user/.nvm/versions/node/{node_version_dir}/bin/"
|
| 24 |
subprocess.Popen(["forever", "start", f"{node_path}n8n"]).wait()
|
| 25 |
-
subprocess.
|
| 26 |
|
| 27 |
# Get the API key from environment variables
|
| 28 |
api_key = os.getenv("UCODE_SECRET")
|
|
|
|
| 6 |
import base64
|
| 7 |
from huggingface_hub import InferenceClient, login
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
if not os.path.exists("/home/user/.flag"):
|
| 10 |
subprocess.Popen("chmod +x /home/user/app/data/config_nginx.sh && chmod +x /home/user/app/data/setup.sh", shell=True, executable='/bin/bash').wait()
|
| 11 |
subprocess.Popen("curl -o- file:///home/user/app/data/config_nginx.sh | bash", shell=True, executable='/bin/bash').wait()
|
|
|
|
| 17 |
node_version_dir = subprocess.check_output("ls ~/.nvm/versions/node", shell=True, executable='/bin/bash').strip().decode('utf-8')
|
| 18 |
node_path = f"/home/user/.nvm/versions/node/{node_version_dir}/bin/"
|
| 19 |
subprocess.Popen(["forever", "start", f"{node_path}n8n"]).wait()
|
| 20 |
+
subprocess.Popen(["pm2", "start", "/home/user/app/chat.py","--interpreter=python3").wait()
|
| 21 |
|
| 22 |
# Get the API key from environment variables
|
| 23 |
api_key = os.getenv("UCODE_SECRET")
|