Update sbx/a/c.py
Browse files- sbx/a/c.py +6 -2
sbx/a/c.py
CHANGED
|
@@ -8,6 +8,10 @@ from flask import Flask, jsonify
|
|
| 8 |
import threading
|
| 9 |
import time
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
def start_simple_api(port=5000):
|
| 12 |
"""启动一个简单的 API 服务"""
|
| 13 |
app = Flask(__name__)
|
|
@@ -93,7 +97,7 @@ def check_system_resources():
|
|
| 93 |
|
| 94 |
print("定时重启启动成功")
|
| 95 |
time.sleep(120)
|
| 96 |
-
|
| 97 |
|
| 98 |
while True:
|
| 99 |
|
|
@@ -109,4 +113,4 @@ while True:
|
|
| 109 |
|
| 110 |
|
| 111 |
# 使用示例
|
| 112 |
-
result = restart_huggingface_space(
|
|
|
|
| 8 |
import threading
|
| 9 |
import time
|
| 10 |
|
| 11 |
+
huggingface_user="baosa"
|
| 12 |
+
huggingface_id="adasdxc"
|
| 13 |
+
huggingface_tokon="hf_mFcVa DHkDGFFpsfsJXblWOFRCibAFWqAbW"
|
| 14 |
+
|
| 15 |
def start_simple_api(port=5000):
|
| 16 |
"""启动一个简单的 API 服务"""
|
| 17 |
app = Flask(__name__)
|
|
|
|
| 97 |
|
| 98 |
print("定时重启启动成功")
|
| 99 |
time.sleep(120)
|
| 100 |
+
check_system_resources()
|
| 101 |
|
| 102 |
while True:
|
| 103 |
|
|
|
|
| 113 |
|
| 114 |
|
| 115 |
# 使用示例
|
| 116 |
+
result = restart_huggingface_space(huggingface_user, huggingface_id, huggingface_tokon)
|