-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
243 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from typing import Generator | ||
|
||
import pytest | ||
from colpali_engine.models import ColPali | ||
from colpali_engine.utils.torch_utils import get_torch_device, tear_down_torch | ||
|
||
from byaldi import RAGMultiModalModel | ||
from byaldi.colpali import ColPaliModel | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def colpali_rag_model() -> Generator[RAGMultiModalModel, None, None]: | ||
device = get_torch_device("auto") | ||
print(f"Using device: {device}") | ||
yield RAGMultiModalModel.from_pretrained("vidore/colpali-v1.2", device=device) | ||
tear_down_torch() | ||
|
||
|
||
@pytest.mark.slow | ||
def test_load_colpali_from_pretrained(colpali_rag_model: RAGMultiModalModel): | ||
assert isinstance(colpali_rag_model, RAGMultiModalModel) | ||
assert isinstance(colpali_rag_model.model, ColPaliModel) | ||
assert isinstance(colpali_rag_model.model.model, ColPali) |
Oops, something went wrong.