Spaces:
Runtime error
Runtime error
import subprocess | |
import os | |
# Set the device to CPU explicitly | |
device = "cpu" | |
print("Using CPU") | |
# Clone YOUR repository - URL CORRECTA | |
subprocess.run(["git", "clone", | |
"https://github.com/Diocal/swappingface", | |
"--single-branch"], check=True) | |
# Change directory to facefusion to run the UI | |
os.chdir("swappingface") | |
# Install dependencies for CPU mode | |
subprocess.run(["python", "install.py", | |
"--onnxruntime", "default", "--skip-conda"], | |
check=True) | |
# AGREGAR ESTAS LΓNEAS PARA HABILITAR API | |
os.environ['GRADIO_SERVER_NAME'] = '0.0.0.0' | |
os.environ['GRADIO_SERVER_PORT'] = '7860' | |
# Run the UI in CPU mode | |
subprocess.run(["python", "facefusion.py", "run", | |
"--execution-providers", "cpu"], check=True) |