ACCA225 commited on
Commit
122ceef
1 Parent(s): 7e7e2f3

Update app1.py

Browse files
Files changed (1) hide show
  1. app1.py +14 -8
app1.py CHANGED
@@ -218,17 +218,23 @@ def monitor_gpu():
218
  time.sleep(60)
219
 
220
  def start():
221
- try:
222
- print('启动proxy')
223
- threading.Thread(target = localProxy,daemon=True).start()
224
- except Exception as e:
225
- # 在这里处理异常的代码
226
- print(f"proxy An error occurred: {e}")
227
  try:
228
  #安装环境
229
- #os.system(f"python launch.py --api --xformers --exit --enable-insecure-extension-access --gradio-queue --disable-safe-unpickle")
230
  #time.sleep(5)
231
- os.system(f"python launch.py --api --xformers --ui-settings-file /home/xlab-app-center/config.json --ui-config-file /home/xlab-app-center/ui-config.json --gradio-queue --disable-safe-unpickle")
 
 
 
 
 
 
232
  except Exception as e:
233
  # 在这里处理异常的代码
234
  print(f"启动SD发生错误: {e}")
 
218
  time.sleep(60)
219
 
220
  def start():
221
+ #try:
222
+ # print('启动proxy')
223
+ # threading.Thread(target = localProxy,daemon=True).start()
224
+ #except Exception as e:
225
+ # # 在这里处理异常的代码
226
+ # print(f"proxy An error occurred: {e}")
227
  try:
228
  #安装环境
229
+ os.system(f"python launch.py --api --xformers --exit --enable-insecure-extension-access --gradio-queue --disable-safe-unpickle")
230
  #time.sleep(5)
231
+
232
+ command = "python launch.py --api --xformers --ui-settings-file /home/xlab-app-center/config.json --ui-config-file /home/xlab-app-center/ui-config.json --gradio-queue --disable-safe-unpickle"
233
+
234
+
235
+ process = subprocess.Popen(command, shell=True)
236
+ time.sleep(120)
237
+ os.system(f"{command} --port=7861 --ngrok=2KPyfzQrHit97J02tARy1ckHJYd_69rJbgjpjnVVeuXD3j9tv ")
238
  except Exception as e:
239
  # 在这里处理异常的代码
240
  print(f"启动SD发生错误: {e}")