gokaygokay
commited on
Commit
•
c337d76
1
Parent(s):
077a1b9
Update README.md
Browse files
README.md
CHANGED
@@ -27,12 +27,12 @@ model_id = "gokaygokay/sd3-long-captioner"
|
|
27 |
url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg?download=true"
|
28 |
image = Image.open(requests.get(url, stream=True).raw)
|
29 |
|
30 |
-
model = PaliGemmaForConditionalGeneration.from_pretrained(model_id).eval()
|
31 |
processor = AutoProcessor.from_pretrained(model_id)
|
32 |
|
33 |
## prefix
|
34 |
prompt = "caption en"
|
35 |
-
model_inputs = processor(text=prompt, images=image, return_tensors="pt")
|
36 |
input_len = model_inputs["input_ids"].shape[-1]
|
37 |
|
38 |
with torch.inference_mode():
|
|
|
27 |
url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg?download=true"
|
28 |
image = Image.open(requests.get(url, stream=True).raw)
|
29 |
|
30 |
+
model = PaliGemmaForConditionalGeneration.from_pretrained(model_id).to('cuda').eval()
|
31 |
processor = AutoProcessor.from_pretrained(model_id)
|
32 |
|
33 |
## prefix
|
34 |
prompt = "caption en"
|
35 |
+
model_inputs = processor(text=prompt, images=image, return_tensors="pt").to('cuda')
|
36 |
input_len = model_inputs["input_ids"].shape[-1]
|
37 |
|
38 |
with torch.inference_mode():
|