Unanswered
In The Case Where I'M Passing A Schedule_Fn To Add_Task In A Taskscheduler, How Do I Pass The Function Arguments?
def watch_folder(folder, batch_size):
count = 0
classes = os.listdir(folder)
class_count = len(classes)
files = []
dirs = []
for cls in classes:
class_dir = os.path.join(folder, cls)
fls = os.listdir(class_dir)
count += len(fls)
files.append(fls)
dirs.append(class_dir)
if count >= batch_size:
dataset = Dataset.create(project='data-repo')
dataset.add_files(folder)
dataset.upload()
dataset.finalize()
dataset.publish()
for i in range(class_count):
f = os.listdir(files[i])
d = dirs[i]
for fname in f:
os.remove(os.path.join(d, fname))
scheduler = TaskScheduler()
scheduler.add_task(schedule_fn=watch_folder,)
187 Views
0
Answers
3 years ago
one year ago