Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,11 +3,11 @@ from PIL import Image
|
|
3 |
from transformers import CLIPModel, AutoTokenizer, AutoProcessor
|
4 |
import torch
|
5 |
|
6 |
-
# Load Jina CLIP model
|
7 |
model_name = "jinaai/jina-clip-v1"
|
8 |
-
model = CLIPModel.from_pretrained(model_name)
|
9 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
10 |
-
processor = AutoProcessor.from_pretrained(model_name)
|
11 |
|
12 |
def compute_similarity(input1, input2, type1, type2):
|
13 |
inputs = []
|
|
|
3 |
from transformers import CLIPModel, AutoTokenizer, AutoProcessor
|
4 |
import torch
|
5 |
|
6 |
+
# Load Jina CLIP model with trust_remote_code=True
|
7 |
model_name = "jinaai/jina-clip-v1"
|
8 |
+
model = CLIPModel.from_pretrained(model_name, trust_remote_code=True)
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
10 |
+
processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
|
11 |
|
12 |
def compute_similarity(input1, input2, type1, type2):
|
13 |
inputs = []
|