Skip to content

Commit

Permalink
Add tqdm for batch looping (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miking98 authored Apr 10, 2024
1 parent 2725eb8 commit 3c5562c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/femr/models/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import transformers
import xformers.ops
from torch import nn
from tqdm import tqdm

import femr.models.config
import femr.models.processor
Expand Down Expand Up @@ -368,7 +369,7 @@ def compute_features(
all_feature_times = []
all_representations = []

for batch in batches:
for batch in tqdm(batches, total=len(batches)):
batch = processor.collate([batch])["batch"]
with torch.no_grad():
_, result = model(batch, return_reprs=True)
Expand Down

0 comments on commit 3c5562c

Please sign in to comment.