Update server2.py
Browse files- server2.py +4 -5
server2.py
CHANGED
|
@@ -3,7 +3,7 @@ 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 = '
|
| 7 |
|
| 8 |
config_data = f"""
|
| 9 |
[common]
|
|
@@ -43,7 +43,6 @@ kaggle_metadata = {
|
|
| 43 |
"id": "xovale7506/sillytavern2-data",
|
| 44 |
"licenses": [{"name": "CC0-1.0"}]
|
| 45 |
}
|
| 46 |
-
st_status = True
|
| 47 |
import subprocess
|
| 48 |
import os
|
| 49 |
import sys
|
|
@@ -472,9 +471,9 @@ def SillyTavern():
|
|
| 472 |
# os.system('kaggle datasets download xovale7506/sillytavern-data2')
|
| 473 |
# 检查文件是否存在
|
| 474 |
if not os.path.exists(f'/{huggingface_Data_name}.zip'):
|
| 475 |
-
print(f"文件 /{huggingface_Data_name}.zip
|
| 476 |
-
|
| 477 |
-
sys.exit()
|
| 478 |
else:
|
| 479 |
|
| 480 |
# 如果文件存在,可以继续执行后续代码
|
|
|
|
| 3 |
ssh_port = '7074'
|
| 4 |
st_url = f'http://{frp_url}:7073'
|
| 5 |
huggingface_name = 'xovale7506'
|
| 6 |
+
huggingface_Data_name = 'sillytavern20-data'
|
| 7 |
|
| 8 |
config_data = f"""
|
| 9 |
[common]
|
|
|
|
| 43 |
"id": "xovale7506/sillytavern2-data",
|
| 44 |
"licenses": [{"name": "CC0-1.0"}]
|
| 45 |
}
|
|
|
|
| 46 |
import subprocess
|
| 47 |
import os
|
| 48 |
import sys
|
|
|
|
| 471 |
# os.system('kaggle datasets download xovale7506/sillytavern-data2')
|
| 472 |
# 检查文件是否存在
|
| 473 |
if not os.path.exists(f'/{huggingface_Data_name}.zip'):
|
| 474 |
+
print(f"文件 /{huggingface_Data_name}.zip 不存在,启用实时同步。")
|
| 475 |
+
subprocess.run(f"rsync -avz -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{frp_url}:/sillytavern/ /sillytavern/", shell=True, check=True)
|
| 476 |
+
# sys.exit()
|
| 477 |
else:
|
| 478 |
|
| 479 |
# 如果文件存在,可以继续执行后续代码
|