Spaces:
Running
Running
admin
commited on
Commit
•
163fe52
1
Parent(s):
2b65c98
Update app.py
Browse files
app.py
CHANGED
@@ -180,11 +180,11 @@ def activate(hf_users: str, ms_users: str):
|
|
180 |
return pd.DataFrame(output)
|
181 |
|
182 |
|
183 |
-
def monitor(hf_users: str, ms_users: str, period=
|
184 |
if schedule.get_jobs():
|
185 |
return
|
186 |
|
187 |
-
print(f"
|
188 |
fixed_activate = partial(activate, hf_users=hf_users, ms_users=ms_users)
|
189 |
schedule.every(period).hours.do(fixed_activate)
|
190 |
while True:
|
@@ -202,7 +202,7 @@ def list_tasks():
|
|
202 |
|
203 |
with gr.Blocks() as iface:
|
204 |
gr.Interface(
|
205 |
-
title="Start keeping all spaces active
|
206 |
fn=monitor,
|
207 |
inputs=[
|
208 |
gr.Textbox(label="HuggingFace", value="monet-joe;MuGeminorum;ccmusic-database"),
|
|
|
180 |
return pd.DataFrame(output)
|
181 |
|
182 |
|
183 |
+
def monitor(hf_users: str, ms_users: str, period=4):
|
184 |
if schedule.get_jobs():
|
185 |
return
|
186 |
|
187 |
+
print(f"监控开启中...每{period}小时触发...")
|
188 |
fixed_activate = partial(activate, hf_users=hf_users, ms_users=ms_users)
|
189 |
schedule.every(period).hours.do(fixed_activate)
|
190 |
while True:
|
|
|
202 |
|
203 |
with gr.Blocks() as iface:
|
204 |
gr.Interface(
|
205 |
+
title="Start keeping all spaces active periodically",
|
206 |
fn=monitor,
|
207 |
inputs=[
|
208 |
gr.Textbox(label="HuggingFace", value="monet-joe;MuGeminorum;ccmusic-database"),
|