Update README.md
Browse files
README.md
CHANGED
@@ -47,18 +47,18 @@ from tqdm import tqdm
|
|
47 |
from transformers import AutoProcessor
|
48 |
from PIL import Image
|
49 |
|
50 |
-
from colpali_engine.models.
|
51 |
from colpali_engine.trainer.retrieval_evaluator import CustomEvaluator
|
52 |
-
from colpali_engine.utils.
|
53 |
from colpali_engine.utils.image_from_page_utils import load_from_dataset
|
54 |
|
55 |
|
56 |
def main() -> None:
|
57 |
-
"""Example script to run inference with
|
58 |
|
59 |
# Load model
|
60 |
-
model_name = "vidore/
|
61 |
-
model =
|
62 |
model.load_adapter(model_name)
|
63 |
processor = AutoProcessor.from_pretrained(model_name)
|
64 |
|
|
|
47 |
from transformers import AutoProcessor
|
48 |
from PIL import Image
|
49 |
|
50 |
+
from colpali_engine.models.idefics_colbert_architecture import ColIdefics
|
51 |
from colpali_engine.trainer.retrieval_evaluator import CustomEvaluator
|
52 |
+
from colpali_engine.utils.colidefics_processing_utils import process_images, process_queries
|
53 |
from colpali_engine.utils.image_from_page_utils import load_from_dataset
|
54 |
|
55 |
|
56 |
def main() -> None:
|
57 |
+
"""Example script to run inference with ColIdefics"""
|
58 |
|
59 |
# Load model
|
60 |
+
model_name = "vidore/colidefics"
|
61 |
+
model = ColIdefics.from_pretrained("HuggingFaceM4/idefics2-8b", torch_dtype=torch.bfloat16, device_map="cuda").eval()
|
62 |
model.load_adapter(model_name)
|
63 |
processor = AutoProcessor.from_pretrained(model_name)
|
64 |
|