Iker commited on
Commit
ea68187
·
1 Parent(s): 57ffa19
Files changed (1) hide show
  1. translate.py +2 -2
translate.py CHANGED
@@ -120,7 +120,7 @@ def main(
120
 
121
  @find_executable_batch_size(starting_batch_size=starting_batch_size)
122
  def inference(batch_size):
123
- nonlocal model, tokenizer, sentences_path, max_length, output_path, lang_code_to_idx, gen_kwargs, total_lines, precision
124
 
125
  print(f"Translating with batch size {batch_size}")
126
 
@@ -137,7 +137,7 @@ def main(
137
  samples_seen: int = 0
138
 
139
  with tqdm(
140
- total=total_lines,
141
  desc="Dataset translation",
142
  leave=True,
143
  ascii=True,
 
120
 
121
  @find_executable_batch_size(starting_batch_size=starting_batch_size)
122
  def inference(batch_size):
123
+ nonlocal model, tokenizer, sentences_path, max_length, output_path, lang_code_to_idx, gen_kwargs, precision
124
 
125
  print(f"Translating with batch size {batch_size}")
126
 
 
137
  samples_seen: int = 0
138
 
139
  with tqdm(
140
+ total=len(data_loader.dataset),
141
  desc="Dataset translation",
142
  leave=True,
143
  ascii=True,