ACCA225 commited on
Commit
e781d44
β€’
1 Parent(s): 0885d48

Update app2.py

Browse files
Files changed (1) hide show
  1. app2.py +7 -5
app2.py CHANGED
@@ -1,5 +1,6 @@
1
  # η»™ζˆ‘ηš„ζœ‹ε‹ε†™ηš„
2
  import os
 
3
  # import wandb
4
  os.system("pip install nvidia-ml-py3")
5
  os.chdir(f"/home/xlab-app-center")
@@ -205,11 +206,7 @@ import time
205
  def wandb():
206
  # Assuming you have initialized WandB before this function call
207
  # ...
208
- try:
209
- localProxy()
210
- except Exception as e:
211
- # εœ¨θΏ™ι‡Œε€„η†εΌ‚εΈΈηš„δ»£η 
212
- print(f"An error occurred: {e}")
213
  while True:
214
  # Loop to continuously monitor GPU temperature and usage
215
  gpu_temperature_command = "nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits"
@@ -219,6 +216,11 @@ def wandb():
219
  time.sleep(60)
220
 
221
  def start():
 
 
 
 
 
222
  try:
223
  os.system(f"python launch.py --api --xformers --exit --enable-insecure-extension-access --ui-settings-file /home/xlab-app-center/config.json --ui-config-file /home/xlab-app-center/ui-config.json --gradio-queue --disable-safe-unpickle")
224
  os.system(f"python launch.py --ngrok=2YypH9d2VXVL78HxF7g0lintH17_2GbtkFNFFngUkTZcyQ4SD --api --xformers --enable-insecure-extension-access --gradio-queue --disable-safe-unpickle & python launch.py --api --xformers --enable-insecure-extension-access --gradio-queue --disable-safe-unpickle --port=7862 & python launch.py --api --xformers --enable-insecure-extension-access --gradio-queue --disable-safe-unpickle --port=7863")
 
1
  # η»™ζˆ‘ηš„ζœ‹ε‹ε†™ηš„
2
  import os
3
+ import threading
4
  # import wandb
5
  os.system("pip install nvidia-ml-py3")
6
  os.chdir(f"/home/xlab-app-center")
 
206
  def wandb():
207
  # Assuming you have initialized WandB before this function call
208
  # ...
209
+
 
 
 
 
210
  while True:
211
  # Loop to continuously monitor GPU temperature and usage
212
  gpu_temperature_command = "nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits"
 
216
  time.sleep(60)
217
 
218
  def start():
219
+ try:
220
+ threading.Thread(target = localProxy,daemon=True).start()
221
+ except Exception as e:
222
+ # εœ¨θΏ™ι‡Œε€„η†εΌ‚εΈΈηš„δ»£η 
223
+ print(f"proxy An error occurred: {e}")
224
  try:
225
  os.system(f"python launch.py --api --xformers --exit --enable-insecure-extension-access --ui-settings-file /home/xlab-app-center/config.json --ui-config-file /home/xlab-app-center/ui-config.json --gradio-queue --disable-safe-unpickle")
226
  os.system(f"python launch.py --ngrok=2YypH9d2VXVL78HxF7g0lintH17_2GbtkFNFFngUkTZcyQ4SD --api --xformers --enable-insecure-extension-access --gradio-queue --disable-safe-unpickle & python launch.py --api --xformers --enable-insecure-extension-access --gradio-queue --disable-safe-unpickle --port=7862 & python launch.py --api --xformers --enable-insecure-extension-access --gradio-queue --disable-safe-unpickle --port=7863")