Update README.md
Browse files
README.md
CHANGED
@@ -85,8 +85,8 @@ def encode(text_or_image_list):
|
|
85 |
embeddings = F.normalize(reps, p=2, dim=1).detach().cpu().numpy()
|
86 |
return embeddings
|
87 |
|
88 |
-
tokenizer = AutoTokenizer.from_pretrained("openbmb/VisRAG", trust_remote_code=True)
|
89 |
-
model = AutoModel.from_pretrained("openbmb/VisRAG", torch_dtype=torch.bfloat16, trust_remote_code=True)
|
90 |
model.eval()
|
91 |
|
92 |
script_dir = os.path.dirname(os.path.realpath(__file__))
|
@@ -96,7 +96,7 @@ passages = [
|
|
96 |
Image.open(os.path.join(script_dir, 'test_image/dog.jpg')).convert('RGB'),
|
97 |
]
|
98 |
|
99 |
-
INSTRUCTION = "Represent this query for retrieving
|
100 |
queries = [INSTRUCTION + query for query in queries]
|
101 |
|
102 |
embeddings_query = encode(queries)
|
|
|
85 |
embeddings = F.normalize(reps, p=2, dim=1).detach().cpu().numpy()
|
86 |
return embeddings
|
87 |
|
88 |
+
tokenizer = AutoTokenizer.from_pretrained("openbmb/VisRAG-Ret", trust_remote_code=True)
|
89 |
+
model = AutoModel.from_pretrained("openbmb/VisRAG-Ret", torch_dtype=torch.bfloat16, trust_remote_code=True)
|
90 |
model.eval()
|
91 |
|
92 |
script_dir = os.path.dirname(os.path.realpath(__file__))
|
|
|
96 |
Image.open(os.path.join(script_dir, 'test_image/dog.jpg')).convert('RGB'),
|
97 |
]
|
98 |
|
99 |
+
INSTRUCTION = "Represent this query for retrieving relevant documents: "
|
100 |
queries = [INSTRUCTION + query for query in queries]
|
101 |
|
102 |
embeddings_query = encode(queries)
|