Feature Extraction
Safetensors
English
minicpmv
VisRAG
custom_code
yushi commited on
Commit
4166f7b
1 Parent(s): 3e90d9e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
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 relavant documents: "
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)