Qilan2 commited on
Commit
b0b482b
·
verified ·
1 Parent(s): 9786f72

Update server2.py

Browse files
Files changed (1) hide show
  1. server2.py +12 -9
server2.py CHANGED
@@ -2,6 +2,9 @@ ini_content = {"username":"xovale7506","key":"502e30bafc004c02aa668a279df23f3e"}
2
  frp_url = '47.237.156.222'
3
  ssh_port = '7074'
4
  st_url = f'http://{frp_url}:7073'
 
 
 
5
  config_data = f"""
6
  [common]
7
  server_addr = {frp_url}
@@ -290,8 +293,8 @@ def check_api1():
290
  n=0
291
  while True:
292
  n = n + 1
293
- if not os.path.exists('/sillytavern2-data.zip') and n > 50:
294
- print("/sillytavern 文件不存在,结束检测")
295
  break
296
  try:
297
  url = "http://127.0.0.1:8000/v1"
@@ -316,8 +319,8 @@ def check_api1():
316
  n = 0
317
  while True:
318
  n = n + 1
319
- if not os.path.exists('/sillytavern2-data.zip') and n > 50:#
320
- print("/sillytavern 文件不存在,结束检测")
321
  break
322
  if Service_status:
323
  print("结束检测")
@@ -464,18 +467,18 @@ def SillyTavern():
464
  os.system("rm -r /a /sillytavern /*.zi* /SillyTavern/")
465
  os.system("mkdir -p /sillytavern")
466
  os.chdir('/')
467
- os.system("kaggle datasets download xovale7506/sillytavern2-data")
468
  # 检查文件是否存在
469
- if not os.path.exists('/sillytavern2-data.zip'):
470
- print(f"文件 /sillytavern2-data.zip 不存在,程序将结束。")
471
  st_status = False
472
  sys.exit()
473
  else:
474
 
475
  # 如果文件存在,可以继续执行后续代码
476
- print(f"文件 /sillytavern2-data.zip 存在,继续执行程序。")
477
  # # 解压 sillytavern.zip
478
- os.system("7z x /sillytavern2-data.zip -o/ -y")
479
  os.system("mv /sillytavern.zip1 /sillytavern.zip")
480
  os.system("7z x /sillytavern.zip -o/sillytavern -y")
481
  os.system("rm *.zip")
 
2
  frp_url = '47.237.156.222'
3
  ssh_port = '7074'
4
  st_url = f'http://{frp_url}:7073'
5
+ huggingface_name = 'xovale7506'
6
+ huggingface_Data_name = 'sillytavern-data2'
7
+
8
  config_data = f"""
9
  [common]
10
  server_addr = {frp_url}
 
293
  n=0
294
  while True:
295
  n = n + 1
296
+ if not os.path.exists(f'/{huggingface_Data_name}.zip') and n > 50:
297
+ print(f"/{huggingface_Data_name} 文件不存在,结束检测")
298
  break
299
  try:
300
  url = "http://127.0.0.1:8000/v1"
 
319
  n = 0
320
  while True:
321
  n = n + 1
322
+ if not os.path.exists(f'/{huggingface_Data_name}.zip') and n > 50:#
323
+ print(f"/{huggingface_Data_name} 文件不存在,结束检测")
324
  break
325
  if Service_status:
326
  print("结束检测")
 
467
  os.system("rm -r /a /sillytavern /*.zi* /SillyTavern/")
468
  os.system("mkdir -p /sillytavern")
469
  os.chdir('/')
470
+ os.system(f"kaggle datasets download {huggingface_name}/{huggingface_Data_name}")
471
  # 检查文件是否存在
472
+ if not os.path.exists(f'/{huggingface_Data_name}.zip'):
473
+ print(f"文件 /{huggingface_Data_name}.zip 不存在,程序将结束。")
474
  st_status = False
475
  sys.exit()
476
  else:
477
 
478
  # 如果文件存在,可以继续执行后续代码
479
+ print(f"文件 /{huggingface_Data_name}.zip 存在,继续执行程序。")
480
  # # 解压 sillytavern.zip
481
+ os.system(f"7z x /{huggingface_Data_name}.zip -o/ -y")
482
  os.system("mv /sillytavern.zip1 /sillytavern.zip")
483
  os.system("7z x /sillytavern.zip -o/sillytavern -y")
484
  os.system("rm *.zip")