Ki-Seki commited on
Commit
414e9a1
1 Parent(s): c2c0cff

fix: optimize tqdm bar update in AutoTab class

Browse files
Files changed (1) hide show
  1. autotab.py +1 -1
autotab.py CHANGED
@@ -142,12 +142,12 @@ class AutoTab:
142
  def run(self):
143
  tqdm_bar = tqdm(total=self.num_data, leave=False)
144
  for start in range(0, self.num_data, self.save_every):
145
- tqdm_bar.update(min(self.save_every, self.num_data - start))
146
  end = min(start + self.save_every, self.num_data)
147
  try:
148
  self.batch_prediction(start, end)
149
  except Exception as e:
150
  print(e)
151
  self.data.to_excel(self.out_file_path, index=False)
 
152
  self.data.to_excel(self.out_file_path, index=False)
153
  print(f"Results saved to {self.out_file_path}")
 
142
  def run(self):
143
  tqdm_bar = tqdm(total=self.num_data, leave=False)
144
  for start in range(0, self.num_data, self.save_every):
 
145
  end = min(start + self.save_every, self.num_data)
146
  try:
147
  self.batch_prediction(start, end)
148
  except Exception as e:
149
  print(e)
150
  self.data.to_excel(self.out_file_path, index=False)
151
+ tqdm_bar.update(min(self.save_every, self.num_data - start))
152
  self.data.to_excel(self.out_file_path, index=False)
153
  print(f"Results saved to {self.out_file_path}")