You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for pdf in sample_pdfs:
page_embeddings = []
dataloader = DataLoader(
pdf["images"],
batch_size=2,
shuffle=False,
collate_fn=lambda x: process_images(processor, x),
)
for batch_doc in tqdm(dataloader):
batch_doc = {k: v.to(device) for k, v in batch_doc.items()}
with torch.no_grad():
with torch.cuda.amp.autocast():
embeddings_doc = model(**batch_doc)
page_embeddings.extend(list(torch.unbind(embeddings_doc.cpu())))
pdf["embeddings"] = page_embeddings
The text was updated successfully, but these errors were encountered: