From 32b7d7cf467c5800ff9ead0e0a7a431954630b55 Mon Sep 17 00:00:00 2001 From: Alex Genovese <423745+alexgenovese@users.noreply.github.com> Date: Sat, 5 Aug 2023 16:07:41 +0200 Subject: [PATCH] Change cuda to device --- preprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preprocess.py b/preprocess.py index 859a03f..eb160e4 100644 --- a/preprocess.py +++ b/preprocess.py @@ -220,7 +220,7 @@ def blip_captioning_dataset( captions = [] print(f"Input captioning text: {text}") for image in tqdm(images): - inputs = processor(image, text=text, return_tensors="pt").to("cuda") + inputs = processor(image, text=text, return_tensors="pt").to(device) out = model.generate( **inputs, max_length=150, do_sample=True, top_k=50, temperature=0.7 )