Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,12 @@
|
|
| 1 |
import subprocess
|
| 2 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
# Clone the repository
|
| 5 |
subprocess.run(["git", "clone", "https://github.com/facefusion/facefusion"], check=True)
|
|
@@ -7,5 +14,8 @@ subprocess.run(["git", "clone", "https://github.com/facefusion/facefusion"], che
|
|
| 7 |
# chande directory to face fusion to run ui
|
| 8 |
os.chdir("facefusion")
|
| 9 |
|
|
|
|
|
|
|
|
|
|
| 10 |
# Run the ui
|
| 11 |
subprocess.run(["python", "run.py", "--execution-providers", "cpu"], check=True)
|
|
|
|
| 1 |
import subprocess
|
| 2 |
import os
|
| 3 |
+
import torch
|
| 4 |
+
|
| 5 |
+
if torch.cuda.is_available():
|
| 6 |
+
!apt-get install nvidia-cuda-toolkit
|
| 7 |
+
print("Using GPU")
|
| 8 |
+
else:
|
| 9 |
+
print("Using CPU")
|
| 10 |
|
| 11 |
# Clone the repository
|
| 12 |
subprocess.run(["git", "clone", "https://github.com/facefusion/facefusion"], check=True)
|
|
|
|
| 14 |
# chande directory to face fusion to run ui
|
| 15 |
os.chdir("facefusion")
|
| 16 |
|
| 17 |
+
# installation
|
| 18 |
+
subprocess.run(["python", "install.py", "--onnxruntime", "cuda-11.8", "--skip-venv"], check=True)
|
| 19 |
+
|
| 20 |
# Run the ui
|
| 21 |
subprocess.run(["python", "run.py", "--execution-providers", "cpu"], check=True)
|