wondervictor commited on
Commit
44698e5
·
verified ·
1 Parent(s): 8c75ec9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -11
app.py CHANGED
@@ -6,19 +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
- # 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',
 
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
+ subprocess.run(['pip', 'show', 'torch'], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
15
+ # result = subprocess.run(['pip', 'install', '-r', 'requirements.txt'], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
16
+ print("安装成功!")
17
+ # print("输出:", result.stdout.decode('utf-8'))
18
+ except subprocess.CalledProcessError as e:
19
+ print("安装失败!")
20
+ print("错误:", e.stderr.decode('utf-8'))
21
 
22
+ install_requirements()
23
 
24
  # hf_hub_download(repo_id='wondervictor/ControlAR',
25
  # filename='canny_MR.safetensors',