root commited on
Commit
c17074c
·
1 Parent(s): 76f5ae6
Files changed (3) hide show
  1. app.py +16 -16
  2. install.sh +1 -1
  3. requirements.txt → my_req.txt +0 -3
app.py CHANGED
@@ -4,22 +4,22 @@ import subprocess
4
  from pathlib import Path
5
 
6
  print(Path(__file__).absolute())
7
- # os.chmod("./install.sh", 0o755)
8
- # try:
9
- # result = subprocess.run(
10
- # ["./install.sh"], # 绝对路径更稳妥
11
- # shell=True,
12
- # check=True,
13
- # stdout=subprocess.PIPE,
14
- # stderr=subprocess.PIPE,
15
- # encoding="utf-8"
16
- # )
17
- # print("脚本执行成功!stdout:", result.stdout)
18
- # except subprocess.CalledProcessError as e:
19
- # # 打印详细错误信息(重点看 stderr)
20
- # print(f"脚本执行失败,状态码:{e.returncode}")
21
- # print(f"脚本输出(stdout):{e.stdout}")
22
- # print(f"脚本错误(stderr):{e.stderr}") # 这里会显示 Shell 执行脚本时的具体报错
23
 
24
 
25
  import sys
 
4
  from pathlib import Path
5
 
6
  print(Path(__file__).absolute())
7
+ os.chmod("./install.sh", 0o755)
8
+ try:
9
+ result = subprocess.run(
10
+ ["./install.sh"], # 绝对路径更稳妥
11
+ shell=True,
12
+ check=True,
13
+ stdout=subprocess.PIPE,
14
+ stderr=subprocess.PIPE,
15
+ encoding="utf-8"
16
+ )
17
+ print("脚本执行成功!stdout:", result.stdout)
18
+ except subprocess.CalledProcessError as e:
19
+ # 打印详细错误信息(重点看 stderr)
20
+ print(f"脚本执行失败,状态码:{e.returncode}")
21
+ print(f"脚本输出(stdout):{e.stdout}")
22
+ print(f"脚本错误(stderr):{e.stderr}") # 这里会显示 Shell 执行脚本时的具体报错
23
 
24
 
25
  import sys
install.sh CHANGED
@@ -3,4 +3,4 @@ echo "install torch done########################################################
3
  echo "==============================================================================================================="
4
  pip install torch==2.6.0 torchvision==0.21.0
5
  pip install -e git+https://github.com/Lakonik/piFlow.git@b1ef16e5e305251bccdfeac2a0e3d0ef339b974a#egg=lakonlab
6
- pip install -r old.txt
 
3
  echo "==============================================================================================================="
4
  pip install torch==2.6.0 torchvision==0.21.0
5
  pip install -e git+https://github.com/Lakonik/piFlow.git@b1ef16e5e305251bccdfeac2a0e3d0ef339b974a#egg=lakonlab
6
+ pip install -r my_req.txt
requirements.txt → my_req.txt RENAMED
@@ -1,6 +1,3 @@
1
- torch
2
- torchvision
3
- -e git+https://github.com/Lakonik/piFlow.git@b1ef16e5e305251bccdfeac2a0e3d0ef339b974a#egg=lakonlab --no-deps
4
  accelerate==1.9.0
5
  aiofiles==24.1.0
6
  aiohappyeyeballs==2.6.1
 
 
 
 
1
  accelerate==1.9.0
2
  aiofiles==24.1.0
3
  aiohappyeyeballs==2.6.1