Nick088 commited on
Commit
70518d9
β€’
1 Parent(s): 66bedce

Make it detect if its running on gpu and so launch it already in gpu else cpu

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -19,4 +19,7 @@ os.chdir("facefusion")
19
  subprocess.run(["python", "install.py", "--onnxruntime", "cuda-11.8", "--skip-conda"], check=True)
20
 
21
  # Run the ui
22
- subprocess.run(["python", "run.py", "--execution-providers", "cpu"], check=True)
 
 
 
 
19
  subprocess.run(["python", "install.py", "--onnxruntime", "cuda-11.8", "--skip-conda"], check=True)
20
 
21
  # Run the ui
22
+ if device=="cuda":
23
+ subprocess.run(["python", "run.py", "--execution-providers", "cpu"], check=True)
24
+ else:
25
+ subprocess.run(["python", "run.py", "--execution-providers", "cpu", "cuda"], check=True)