Qilan2 commited on
Commit
6647ef8
·
verified ·
1 Parent(s): ac5a16e

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +5 -1
server.py CHANGED
@@ -276,9 +276,13 @@ def requests_retry_session(retries=3, backoff_factor=0.3, status_forcelist=(500,
276
  return session
277
 
278
  def check_api1():
 
279
  # 第一次检查 SillyTavern 是否启动
280
  thread_started = False # 在函数内初始化标志变量
281
  while True:
 
 
 
282
  try:
283
  url = "http://127.0.0.1:8000/v1"
284
  response = requests.get(url, timeout=30)
@@ -433,7 +437,7 @@ def SillyTavern():
433
  os.system("kaggle datasets download xovale7506/sillytavern-data1")
434
  # 检查文件是否存在
435
  if not os.path.exists('/sillytavern-data.zip'):
436
- print(f"文件 {file_path} 不存在,程序将结束。")
437
  st_status = False
438
  # 如果文件存在,可以继续执行后续代码
439
  print(f"文件 {file_path} 存在,继续执行程序。")
 
276
  return session
277
 
278
  def check_api1():
279
+
280
  # 第一次检查 SillyTavern 是否启动
281
  thread_started = False # 在函数内初始化标志变量
282
  while True:
283
+ if st_status:
284
+ print("结束检测")
285
+ break
286
  try:
287
  url = "http://127.0.0.1:8000/v1"
288
  response = requests.get(url, timeout=30)
 
437
  os.system("kaggle datasets download xovale7506/sillytavern-data1")
438
  # 检查文件是否存在
439
  if not os.path.exists('/sillytavern-data.zip'):
440
+ print(f"文件 /sillytavern-data.zip 不存在,程序将结束。")
441
  st_status = False
442
  # 如果文件存在,可以继续执行后续代码
443
  print(f"文件 {file_path} 存在,继续执行程序。")