Spaces:
Sleeping
Sleeping
Yunshansongbai
commited on
Commit
•
c2edf17
1
Parent(s):
4393886
Update app.py
Browse files
app.py
CHANGED
@@ -34,14 +34,12 @@ cache_model = {}
|
|
34 |
def callback(text):
|
35 |
if text == "reboot":
|
36 |
os._exit(0)
|
37 |
-
|
38 |
-
one_hour_later = current_time + timedelta(hours=1)
|
39 |
else:
|
40 |
global start_time
|
41 |
if time.time() - start_time >= 3600:
|
42 |
os._exit(0)
|
43 |
-
|
44 |
-
one_hour_later = current_time + timedelta(hours=1)
|
45 |
else:
|
46 |
return text
|
47 |
|
@@ -181,9 +179,7 @@ with app:
|
|
181 |
song_output = gr.Audio(label="输出歌曲",interactive=False)
|
182 |
|
183 |
with gr.TabItem("设置"):
|
184 |
-
|
185 |
-
current_time = datetime.now()
|
186 |
-
one_hour_later = current_time + timedelta(hours=1)
|
187 |
output = gr.Textbox(label="输出",placeholder=f"距离下一次允许重启时间为{one_hour_later}")
|
188 |
btn_reboot = gr.Button("重启",variant="primary")
|
189 |
btn_separate.click(separate_fn, song_input, [text_output1, vocal_output1,instrumental_output1,vocal_input1,instrumental_input1])
|
|
|
34 |
def callback(text):
|
35 |
if text == "reboot":
|
36 |
os._exit(0)
|
37 |
+
one_hour_later = datetime.now() + timedelta(hours=1)
|
|
|
38 |
else:
|
39 |
global start_time
|
40 |
if time.time() - start_time >= 3600:
|
41 |
os._exit(0)
|
42 |
+
one_hour_later = datetime.now() + timedelta(hours=1)
|
|
|
43 |
else:
|
44 |
return text
|
45 |
|
|
|
179 |
song_output = gr.Audio(label="输出歌曲",interactive=False)
|
180 |
|
181 |
with gr.TabItem("设置"):
|
182 |
+
one_hour_later = datetime.now() + timedelta(hours=1)
|
|
|
|
|
183 |
output = gr.Textbox(label="输出",placeholder=f"距离下一次允许重启时间为{one_hour_later}")
|
184 |
btn_reboot = gr.Button("重启",variant="primary")
|
185 |
btn_separate.click(separate_fn, song_input, [text_output1, vocal_output1,instrumental_output1,vocal_input1,instrumental_input1])
|