Spaces:
Runtime error
Runtime error
import subprocess | |
# Gantilah "app.py" dengan nama berkas aplikasi Python Anda | |
pip_script = "install -r requirements.txt" | |
# batch_file_path = "./.run.bat" | |
python_script = "entry_with_update.py" | |
# Argument yang ingin Anda tambahkan | |
additional_arguments = ["--listen", "--port", "--in-browser", "--vae-in-cpu", "--attention-split", "--multi-user", "--always-cpu", "--share"] | |
# Gabungkan semua argumen | |
PIP = ["pip", pip_script] | |
command = ["python", python_script] + additional_arguments | |
# Jalankan skrip menggunakan subprocess | |
subprocess.run(PIP) | |
subprocess.run(command)# Menjalankan file batch | |
# subprocess.run([batch_file_path], shell=True) | |