Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from transformers import CLIPProcessor, CLIPModel
|
|
6 |
model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
|
7 |
processor = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32")
|
8 |
|
9 |
-
def image_feature(
|
10 |
image = Image.open(requests.get(url, stream=True).raw)
|
11 |
inputs = processor(images=image, return_tensors="pt")
|
12 |
image_features = model.get_image_features(**inputs)
|
|
|
6 |
model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
|
7 |
processor = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32")
|
8 |
|
9 |
+
def image_feature(url):
|
10 |
image = Image.open(requests.get(url, stream=True).raw)
|
11 |
inputs = processor(images=image, return_tensors="pt")
|
12 |
image_features = model.get_image_features(**inputs)
|