Update README.md
Browse files
README.md
CHANGED
|
@@ -42,7 +42,7 @@ url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
|
| 42 |
image = Image.open(requests.get(url, stream=True).raw)
|
| 43 |
|
| 44 |
texts = ["a photo of 2 cats", "a photo of 2 dogs"]
|
| 45 |
-
inputs = processor(text=texts, images=image, return_tensors="pt")
|
| 46 |
|
| 47 |
with torch.no_grad():
|
| 48 |
outputs = model(**inputs)
|
|
|
|
| 42 |
image = Image.open(requests.get(url, stream=True).raw)
|
| 43 |
|
| 44 |
texts = ["a photo of 2 cats", "a photo of 2 dogs"]
|
| 45 |
+
inputs = processor(text=texts, images=image, padding="max_length", return_tensors="pt")
|
| 46 |
|
| 47 |
with torch.no_grad():
|
| 48 |
outputs = model(**inputs)
|