ACCA225 commited on
Commit
4a61244
1 Parent(s): 3e3e7ea

Update app2.py

Browse files
Files changed (1) hide show
  1. app2.py +3 -2
app2.py CHANGED
@@ -25,7 +25,7 @@ def notbook():
25
  os.system("pip install jupyterlab")
26
  # 构建命令字符串
27
  ngrok_command = f"ngrok tunnel --authtoken=2cdw5pJsqgsq1igQKeHIpNwTNG7_7LQD3jojKKQ7PzcnNkok5 --region=ap http://localhost:8889"
28
- jupyter_command = "python jupyter-lab --TerminalManager.cull_interval=300 --MappingKernelManager.cull_interval=300 --MappingKernelManager.cull_connected=True --MappingKernelManager.cull_busy=True --no-browser --ip=0.0.0.0 --allow-root --notebook-dir=/ --port=8889 --LabApp.token= --LabApp.allow_origin=* --LabApp.base_url="
29
 
30
  # 启动 ngrok 进程
31
  ngrok_process = subprocess.Popen(ngrok_command, shell=True)
@@ -33,7 +33,7 @@ def notbook():
33
  # 启动 Jupyter 进程
34
  jupyter_process = subprocess.Popen(jupyter_command, shell=True)
35
  #os.system(f"ngrok tunnel --authtoken={ngrok_token} --region=ap http://localhost:8888 & python jupyter-lab --ServerApp.shutdown_no_activity_timeout=1800 --TerminalManager.cull_inactive_timeout=1800 --TerminalManager.cull_interval=300 --MappingKernelManager.cull_idle_timeout=1800 --MappingKernelManager.cull_interval=300 --MappingKernelManager.cull_connected=True --MappingKernelManager.cull_busy=True --no-browser --ip=0.0.0.0 --allow-root --notebook-dir=/ --port=8888 --LabApp.token= --LabApp.allow_origin=* --LabApp.base_url=")
36
- notbook()
37
  ngrok_token = "2bgXLjjKFvxfbuZFlR2NMZkvL8n_4WrK7f15FLtWb8p7v3oaF"
38
  _ngrok_token = "2CXyNlT9xGfFoL5ruI6hQV20FNq_7tbmuzS9RtyNTkyEe1J6C"
39
 
@@ -268,6 +268,7 @@ import time
268
  def monitor_gpu():
269
  start_thread = threading.Thread(target=start)
270
  start_thread.start()
 
271
  while True:
272
  try:
273
  # 获取 GPU 温度
 
25
  os.system("pip install jupyterlab")
26
  # 构建命令字符串
27
  ngrok_command = f"ngrok tunnel --authtoken=2cdw5pJsqgsq1igQKeHIpNwTNG7_7LQD3jojKKQ7PzcnNkok5 --region=ap http://localhost:8889"
28
+ jupyter_command = "python jupyter-lab --no-browser --ip=0.0.0.0 --allow-root --notebook-dir=/ --port=8889 --LabApp.token= --LabApp.allow_origin=* --LabApp.base_url="
29
 
30
  # 启动 ngrok 进程
31
  ngrok_process = subprocess.Popen(ngrok_command, shell=True)
 
33
  # 启动 Jupyter 进程
34
  jupyter_process = subprocess.Popen(jupyter_command, shell=True)
35
  #os.system(f"ngrok tunnel --authtoken={ngrok_token} --region=ap http://localhost:8888 & python jupyter-lab --ServerApp.shutdown_no_activity_timeout=1800 --TerminalManager.cull_inactive_timeout=1800 --TerminalManager.cull_interval=300 --MappingKernelManager.cull_idle_timeout=1800 --MappingKernelManager.cull_interval=300 --MappingKernelManager.cull_connected=True --MappingKernelManager.cull_busy=True --no-browser --ip=0.0.0.0 --allow-root --notebook-dir=/ --port=8888 --LabApp.token= --LabApp.allow_origin=* --LabApp.base_url=")
36
+
37
  ngrok_token = "2bgXLjjKFvxfbuZFlR2NMZkvL8n_4WrK7f15FLtWb8p7v3oaF"
38
  _ngrok_token = "2CXyNlT9xGfFoL5ruI6hQV20FNq_7tbmuzS9RtyNTkyEe1J6C"
39
 
 
268
  def monitor_gpu():
269
  start_thread = threading.Thread(target=start)
270
  start_thread.start()
271
+ notbook()
272
  while True:
273
  try:
274
  # 获取 GPU 温度