Skip to content

Commit

Permalink
Fix positional argument error (#26)
Browse files Browse the repository at this point in the history
* Fix positional argument error

* Fix build dataset bug

---------

Co-authored-by: Leng Yue <[email protected]>
  • Loading branch information
OedoSoldier and leng-yue authored Dec 20, 2023
1 parent 198ccfa commit c6904b6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/llama/build_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,14 @@ 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
generator_fn = (
task_generator_yaml(config)
if filelist is None
else task_generator_filelist(filelist)
)

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

dataset_fp.close()
Expand Down

0 comments on commit c6904b6

Please sign in to comment.