BBrother commited on
Commit
40a6b24
1 Parent(s): d701ae7

Update no_logs_launch.py

Browse files
Files changed (1) hide show
  1. no_logs_launch.py +5 -5
no_logs_launch.py CHANGED
@@ -29,15 +29,15 @@ start = launch_utils.start
29
  def main():
30
  if not args.skip_prepare_environment:
31
  prepare_environment()
32
- # 这里我用了一个特殊的参数/dev/null,它会把所有的输出都丢弃掉,相当于不输出任何东西
33
- os.system(f"sed -i -e 's/dict()))/dict())).cuda()/g' {util_py_path} > /dev/null")
34
- os.system(f"sed -i -e 's/stable/dict()))/dict())).cuda()/g' /bushu/ui/repositories/diffusion-stability-stable/ldm/util.py > /dev/null")
35
 
36
  if args.test_server:
37
  configure_for_tests()
38
 
39
- # 这里我也用了/dev/null,把start函数的输出都忽略掉了
40
- os.system(f"{python} {start} > /dev/null")
41
 
42
 
43
  if __name__ == "__main__":
 
29
  def main():
30
  if not args.skip_prepare_environment:
31
  prepare_environment()
32
+ # 这里我用了os.popen函数,它会返回一个文件对象,而不会输出到标准输出流
33
+ os.popen(f"sed -i -e 's/dict()))/dict())).cuda()/g' {util_py_path}")
34
+ os.popen(f"sed -i -e 's/stable/dict()))/dict())).cuda()/g' /bushu/ui/repositories/diffusion-stability-stable/ldm/util.py")
35
 
36
  if args.test_server:
37
  configure_for_tests()
38
 
39
+ # 这里我也用了os.popen函数,把start函数的输出都忽略掉了
40
+ os.popen(f"{python} {start}")
41
 
42
 
43
  if __name__ == "__main__":