Update README.md
Browse files
README.md
CHANGED
|
@@ -31,7 +31,7 @@ from transformers import pipeline
|
|
| 31 |
|
| 32 |
clip = pipeline(
|
| 33 |
task="zero-shot-image-classification",
|
| 34 |
-
model="
|
| 35 |
torch_dtype=torch.bfloat16,
|
| 36 |
device=0
|
| 37 |
)
|
|
@@ -50,8 +50,8 @@ from PIL import Image
|
|
| 50 |
from transformers import AutoProcessor, AutoModel
|
| 51 |
|
| 52 |
# note: make sure to verify that `AutoModel` is an instance of `MetaClip2Model`
|
| 53 |
-
model = AutoModel.from_pretrained("
|
| 54 |
-
processor = AutoProcessor.from_pretrained("
|
| 55 |
|
| 56 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
| 57 |
image = Image.open(requests.get(url, stream=True).raw)
|
|
|
|
| 31 |
|
| 32 |
clip = pipeline(
|
| 33 |
task="zero-shot-image-classification",
|
| 34 |
+
model="facebook/metaclip-2-mt5-worldwide-b32",
|
| 35 |
torch_dtype=torch.bfloat16,
|
| 36 |
device=0
|
| 37 |
)
|
|
|
|
| 50 |
from transformers import AutoProcessor, AutoModel
|
| 51 |
|
| 52 |
# note: make sure to verify that `AutoModel` is an instance of `MetaClip2Model`
|
| 53 |
+
model = AutoModel.from_pretrained("facebook/metaclip-2-mt5-worldwide-b32", torch_dtype=torch.bfloat16, attn_implementation="sdpa")
|
| 54 |
+
processor = AutoProcessor.from_pretrained("facebook/metaclip-2-mt5-worldwide-b32")
|
| 55 |
|
| 56 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
| 57 |
image = Image.open(requests.get(url, stream=True).raw)
|