wondervictor commited on
Commit
6ca9756
·
verified ·
1 Parent(s): b8cecf5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -6,6 +6,20 @@ from app_canny import create_demo as create_demo_canny
6
  from app_depth import create_demo as create_demo_depth
7
  import os
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  # hf_hub_download(repo_id='wondervictor/ControlAR',
10
  # filename='canny_MR.safetensors',
11
  # local_dir='./checkpoints/')
 
6
  from app_depth import create_demo as create_demo_depth
7
  import os
8
 
9
+ import subprocess
10
+
11
+ def install_requirements():
12
+ try:
13
+ subprocess.run(['pip', 'install', 'torch==2.1.2+cu118', '--extra-index-url', 'https://download.pytorch.org/whl/cu118'], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
14
+ result = subprocess.run(['pip', 'install', '-r', 'requirements.txt'], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
15
+ print("安装成功!")
16
+ print("输出:", result.stdout.decode('utf-8'))
17
+ except subprocess.CalledProcessError as e:
18
+ print("安装失败!")
19
+ print("错误:", e.stderr.decode('utf-8'))
20
+
21
+ install_requirements()
22
+
23
  # hf_hub_download(repo_id='wondervictor/ControlAR',
24
  # filename='canny_MR.safetensors',
25
  # local_dir='./checkpoints/')