Skip to content

Commit

Permalink
Update build dataset generator selection
Browse files Browse the repository at this point in the history
  • Loading branch information
leng-yue committed Dec 20, 2023
1 parent 4f02d63 commit a2e3f6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/llama/build_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ def run_task(task):
@click.option("--num_worker", type=int, default=16)
def main(config, output, filelist, num_worker):
dataset_fp = open(output, "wb")
generator_fn = task_generator_yaml if filelist is None else task_generator_filelist

with Pool(num_worker) as p:
for result in tqdm(
p.imap_unordered(run_task, task_generator(config, filelist))
):
for result in tqdm(p.imap_unordered(run_task, generator_fn(config, filelist))):
dataset_fp.write(result)

dataset_fp.close()
Expand Down

0 comments on commit a2e3f6e

Please sign in to comment.