mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-11 15:47:01 -07:00
add launch prog by timer repeatedly for colab
This commit is contained in:
parent
b50220a7d1
commit
35ab63f752
1 changed files with 11 additions and 2 deletions
|
@ -81,14 +81,23 @@ def trainerThread (s2c, c2s, args, device_args):
|
|||
|
||||
last_save_time = time.time()
|
||||
|
||||
execute_programs = [ [x[0], x[1], time.time() ] for x in execute_programs ]
|
||||
|
||||
for i in itertools.count(0,1):
|
||||
if not debug:
|
||||
cur_time = time.time()
|
||||
|
||||
for x in execute_programs:
|
||||
prog_time, prog = x
|
||||
if prog_time != 0 and (cur_time - start_time) >= prog_time:
|
||||
prog_time, prog, last_time = x
|
||||
exec_prog = False
|
||||
if prog_time > 0 and (cur_time - start_time) >= prog_time:
|
||||
x[0] = 0
|
||||
exec_prog = True
|
||||
elif prog_time < 0 and (cur_time - last_time) >= -prog_time:
|
||||
x[2] = cur_time
|
||||
exec_prog = True
|
||||
|
||||
if exec_prog:
|
||||
try:
|
||||
exec(prog)
|
||||
except Exception as e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue