Skip to content

Commit

Permalink
refactor: replace .total with sum of values
Browse files Browse the repository at this point in the history
  • Loading branch information
vejvarm committed Nov 27, 2023
1 parent dcd6861 commit cf6af61
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lab/merge_datasets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from collections import Counter
from pathlib import Path
from tqdm import tqdm
import shutil
Expand Down Expand Up @@ -83,7 +82,7 @@ def main(args):
csqa_d2t_files = list_files(csqa_d2t_dir / subset, shuffle=True)

# calculate num samples from D2T for enrichment from ratio
csqa_total_turns = Counter(csqa_stats[subset]).total()
csqa_total_turns = sum(csqa_stats[subset].values()) # equivalent to Counter(csqa_stats[subset]).total()
if ratio == -1:
csqa_d2t_size = len(csqa_d2t_files)
else:
Expand Down

0 comments on commit cf6af61

Please sign in to comment.