Update server.py
Browse files
server.py
CHANGED
|
@@ -6,23 +6,20 @@ import zipfile
|
|
| 6 |
import os
|
| 7 |
import time
|
| 8 |
import json
|
| 9 |
-
|
| 10 |
-
# from requests.packages.urllib3.util.retry import Retry
|
| 11 |
-
# from IPython.display import HTML, display
|
| 12 |
-
# import configparser
|
| 13 |
|
| 14 |
|
| 15 |
huggiingface_repo_id = 'Qi28/SD_QZ' # Hugging Face 数据集 ID
|
| 16 |
huggiingface_path = 'frp'
|
| 17 |
download_path = '/tmp/code/frp'
|
| 18 |
-
frp_status =
|
| 19 |
nps_status = 1 #是否启用nps, 0 否 1 是
|
| 20 |
sd_url = 'http://119.8.118.149:8000'
|
| 21 |
NPS_key = 'q9wj1cnlek4j3hg5'
|
| 22 |
NPS_server = '119.8.118.149:7001'
|
| 23 |
nezha_agent_key = 'L3USpU8bbpHRV90uuC'
|
| 24 |
nezha_agent_url = 'nzzz.nwb.lol:5555'
|
| 25 |
-
print(frp_status
|
| 26 |
|
| 27 |
#!export CUDA_VISIBLE_DEVICES=0,1
|
| 28 |
|
|
@@ -174,10 +171,10 @@ def check_api1():
|
|
| 174 |
print("接口正常2")
|
| 175 |
except requests.exceptions.ConnectionError as e:
|
| 176 |
print(f"接口异常1: {e}")
|
| 177 |
-
if frp_status
|
| 178 |
print("启动FRP")
|
| 179 |
threading.Thread(target=Frpc, daemon=True).start()
|
| 180 |
-
if nps_status
|
| 181 |
print("启动NPS")
|
| 182 |
threading.Thread(target=NPS, daemon=True).start()
|
| 183 |
# threading.Thread(target=run_script).start()
|
|
@@ -185,10 +182,10 @@ def check_api1():
|
|
| 185 |
break
|
| 186 |
except requests.exceptions.Timeout as e:
|
| 187 |
print(f"接口异常2: {e}")
|
| 188 |
-
if frp_status
|
| 189 |
print("启动FRP")
|
| 190 |
threading.Thread(target=Frpc, daemon=True).start()
|
| 191 |
-
if nps_status
|
| 192 |
print("启动NPS")
|
| 193 |
threading.Thread(target=NPS, daemon=True).start()
|
| 194 |
# threading.Thread(target=run_script).start()
|
|
@@ -197,10 +194,10 @@ def check_api1():
|
|
| 197 |
|
| 198 |
except requests.exceptions.RequestException as e:
|
| 199 |
print(f"接口异常3: {e}")
|
| 200 |
-
if frp_status
|
| 201 |
print("启动FRP")
|
| 202 |
threading.Thread(target=Frpc, daemon=True).start()
|
| 203 |
-
if nps_status
|
| 204 |
print("启动NPS")
|
| 205 |
threading.Thread(target=NPS, daemon=True).start()
|
| 206 |
# threading.Thread(target=run_script).start()
|
|
|
|
| 6 |
import os
|
| 7 |
import time
|
| 8 |
import json
|
| 9 |
+
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
huggiingface_repo_id = 'Qi28/SD_QZ' # Hugging Face 数据集 ID
|
| 13 |
huggiingface_path = 'frp'
|
| 14 |
download_path = '/tmp/code/frp'
|
| 15 |
+
frp_status = False #是否启用frp, 0 否 1 是
|
| 16 |
nps_status = 1 #是否启用nps, 0 否 1 是
|
| 17 |
sd_url = 'http://119.8.118.149:8000'
|
| 18 |
NPS_key = 'q9wj1cnlek4j3hg5'
|
| 19 |
NPS_server = '119.8.118.149:7001'
|
| 20 |
nezha_agent_key = 'L3USpU8bbpHRV90uuC'
|
| 21 |
nezha_agent_url = 'nzzz.nwb.lol:5555'
|
| 22 |
+
print(frp_status)
|
| 23 |
|
| 24 |
#!export CUDA_VISIBLE_DEVICES=0,1
|
| 25 |
|
|
|
|
| 171 |
print("接口正常2")
|
| 172 |
except requests.exceptions.ConnectionError as e:
|
| 173 |
print(f"接口异常1: {e}")
|
| 174 |
+
if frp_status:
|
| 175 |
print("启动FRP")
|
| 176 |
threading.Thread(target=Frpc, daemon=True).start()
|
| 177 |
+
if nps_status:
|
| 178 |
print("启动NPS")
|
| 179 |
threading.Thread(target=NPS, daemon=True).start()
|
| 180 |
# threading.Thread(target=run_script).start()
|
|
|
|
| 182 |
break
|
| 183 |
except requests.exceptions.Timeout as e:
|
| 184 |
print(f"接口异常2: {e}")
|
| 185 |
+
if frp_status:
|
| 186 |
print("启动FRP")
|
| 187 |
threading.Thread(target=Frpc, daemon=True).start()
|
| 188 |
+
if nps_status:
|
| 189 |
print("启动NPS")
|
| 190 |
threading.Thread(target=NPS, daemon=True).start()
|
| 191 |
# threading.Thread(target=run_script).start()
|
|
|
|
| 194 |
|
| 195 |
except requests.exceptions.RequestException as e:
|
| 196 |
print(f"接口异常3: {e}")
|
| 197 |
+
if frp_status:
|
| 198 |
print("启动FRP")
|
| 199 |
threading.Thread(target=Frpc, daemon=True).start()
|
| 200 |
+
if nps_status:
|
| 201 |
print("启动NPS")
|
| 202 |
threading.Thread(target=NPS, daemon=True).start()
|
| 203 |
# threading.Thread(target=run_script).start()
|